{{ message }}
gh-112071: Make _random.Random methods thread-safe in --disable-gil builds - #112128
Merged
corona10 merged 3 commits intoNov 28, 2023
Conversation
…l` builds Guard `_random.Random` methods with critical section API locks by using `@critical_section` AC directive
colesbury
approved these changes
Nov 15, 2023
colesbury
left a comment
Contributor
There was a problem hiding this comment.
Thanks @chgnrdv, this LGTM.
@rhettinger, would you be able to review this? This adds @critical_section Argument Clinic directives to the methods of _random.Random. In --disable-gil builds, this acquires/releases the per-object locks around the methods. They are no-ops in the default build.
corona10
requested changes
Nov 22, 2023
Member
There was a problem hiding this comment.
You don't need to add this header manually since the AC automatically adds it.
Please rebase the branch and rerun the make clinic
rhettinger
approved these changes
Nov 23, 2023
corona10
approved these changes
Nov 28, 2023
corona10
left a comment
Member
There was a problem hiding this comment.
LGTM (with my own push) cc @colesbury
corona10
enabled auto-merge (squash)
November 28, 2023 03:06
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
…ble-gil` builds (pythongh-112128) Co-authored-by: Donghee Na <donghee.na@python.org>
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
…ble-gil` builds (pythongh-112128) Co-authored-by: Donghee Na <donghee.na@python.org>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Guard
_random.Randommethods with critical section API locks by using@critical_sectionAC directive.Fixes #112071
random.Randomthread-safe in--disable-gilbuilds #112071