FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-152075: Avoid lock contention in _Py_Specialize_LoadGlobal under free threading (gh-153720) by miss-islington · Pull Request #158905 · python/cpython · GitHub

Repository navigation

[3.15] gh-152075: Avoid lock contention in _Py_Specialize_LoadGlobal under free threading (gh-153720) - #158905

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-ac8ba0c-3.15
Open

miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-ac8ba0c-3.15

Conversation

miss-islington commented Oct 6, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

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.
(cherry picked from commit ac8ba0c)

Co-authored-by: Peter Hawkins phawkins@google.com

…nder free threading (pythongh-153720)

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.
(cherry picked from commit ac8ba0c)

Co-authored-by: Peter Hawkins <phawkins@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL