-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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-112050: Make collections.deque thread-safe in free-threaded builds #113830
Conversation
Convert most methods on collections.deque to use clinic. This will allow us to use clinic's `@critical_section` directive when making deques thread-safe for `--gil-disabled`, simplifying the implementation.
Clear is used only by the GC; no other threads are running.
Great; let's wait with landing this until we've got those. |
@erlend-aasland Here are some benchmark numbers using the default
|
@erlend-aasland - I think everything is addressed now. Would you please have another look? |
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.
Thanks!
I'm inclined to run the buildbots on this; Thomas is cooking up the release right now, so we really don't want one of the bots to turn red right now. |
🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 6ffad44 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
@erlend-aasland - Just noticed one last place where we want to use the macro wrapper. Would you please kick off another buildbot run. Sorry for the churn. |
You should be able to trigger the buildbot run yourself, now you're a triager! :) |
Oho - I'm drunk with power now! :P |
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
This uses critical sections to make
deque
methods that operate on mutable state thread-safe when the GIL is disabled. This is mostly accomplished by using the@critical_section
clinic directive, though there are a few places where this was not possible and critical sections had to be manually acquired/released.--disable-gil
builds #112050