-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-120974: Make _asyncio._enter_task atomic in the free-threaded build #122138
gh-120974: Make _asyncio._enter_task atomic in the free-threaded build #122138
Conversation
…d build Use `PyDict_SetDefaultRef` to set the current task in a single operation under the dictionary's lock.
Still need to address The goal with this PR is thread-safety in the free-threaded build, but it also seems to slightly improve performance of Here's a little microbenchmark I'm using: https://gist.github.com/colesbury/ece2f1a5cbc4c50f86c8634744a9badc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @colesbury for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…d build (pythonGH-122138) Use `PyDict_SetDefaultRef` to set the current task in a single operation under the dictionary's lock. (cherry picked from commit 47847aa) Co-authored-by: Sam Gross <[email protected]>
GH-122152 is a backport of this pull request to the 3.13 branch. |
…d build (python#122138) Use `PyDict_SetDefaultRef` to set the current task in a single operation under the dictionary's lock.
…d build (python#122138) Use `PyDict_SetDefaultRef` to set the current task in a single operation under the dictionary's lock.
Use
PyDict_SetDefaultRef
to set the current task in a single operation under the dictionary's lock.asyncio
thread-safety issues in the free-threaded build #120974