OpenBLAS controlling thread logic needs to be smarter when thre are overlapping set/restore pairs in different threads

Offen
#299 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@itamarst arbeitet bereits daran.

Seit 05.11.2026.

  • #300 von @itamarst — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
performance

Rechercherichtung

Start with the linked pull request #300 and the thread-limit set/restore logic it discusses. Trace how control ownership and saved limits behave in the two-thread scenario described in the issue. Done means a thread that failed to set a limit cannot later restore one and acquire control unexpectedly; verify the behavior with a regression test for the overlapping pairs.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Based on https://github.com/joblib/joblib/pull/1871#issuecomment-6663799616

Scenario:

  1. Initial limit is L.
  2. Thread 1 limits to M, stores the fact that previously limit was L. Thread 1 becomes controlling thread.
  3. Thread 2 tries to limit to N, but fails, stores the fact that previously limit was M.
  4. Thread 1 restores to L and releases control of thread.
  5. Thread 2 restores to N, acquiring control as it does so.

The straightforward solution here is something like "if a thread failed to set because it wasn't the controlling thread, it shouldn't restore either."

Vorherrschende Sprache
Python
Sterne
434
Forks
38
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
18

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus joblib/threadpoolctl

Alle Issues in joblib/threadpoolctl

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.