Commit 77aabda
committed
gh-152075: Avoid lock contention in _Py_Specialize_LoadGlobal under free threading
Under high thread concurrency in free-threaded builds, `_Py_Specialize_LoadGlobal` suffers from lock contention when acquiring the critical section mutexes for the `globals` and `builtins` dictionaries during bytecode specialization.
This PR skips LOAD_GLOBAL bytecode specialization if acquiring the two object mutexes would block.1 parent 8b048eb commit 77aabda
2 files changed
Lines changed: 10 additions & 0 deletions
File tree
- Misc/NEWS.d/next/Core_and_Builtins
- Python
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1460 | 1468 | | |
1461 | 1469 | | |
1462 | 1470 | | |
| |||
0 commit comments