Skip to content

[3.14] gh-162764: Avoid 1 ms STW delay when a thread detaches (GH-162771) - #163131

Open
nascheme wants to merge 1 commit into
python:3.14from
nascheme:backport-ce50df4-3.14
Open

nascheme wants to merge 1 commit into
python:3.14from
nascheme:backport-ce50df4-3.14

Conversation

@nascheme

@nascheme nascheme commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Reduce the latency of stop-the-world pauses in the free-threaded build. Threads that detach (for example, to block on a lock or around a blocking call) while a pause is pending now notify the requesting thread. Previously, such pauses could be delayed by about one millisecond.

The 3.14 version omits the _Py_THREAD_DETACHED_WAITING handling, since that state (gh-151518) does not exist on this branch.

(cherry picked from commit ce50df4)

…ythonGH-162771)

Reduce the latency of stop-the-world pauses in the free-threaded build.
Threads that detach (for example, to block on a lock or around a blocking
call) while a pause is pending now notify the requesting thread.
Previously, such pauses could be delayed by about one millisecond.

The 3.14 version omits the _Py_THREAD_DETACHED_WAITING handling, since
that state (pythongh-151518) does not exist on this branch.
(cherry picked from commit ce50df4)
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @nascheme for commit 5e54fec 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F163131%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 4, 2026
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.

2 participants