-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Make random.Random
thread-safe in --disable-gil
builds
#112071
Labels
3.13
bugs and security fixes
extension-modules
C modules in the Modules dir
topic-free-threading
type-feature
A feature request or enhancement
Comments
colesbury
added
type-feature
A feature request or enhancement
3.13
bugs and security fixes
topic-free-threading
labels
Nov 14, 2023
chgnrdv
added a commit
to chgnrdv/cpython
that referenced
this issue
Nov 15, 2023
…ble-gil` builds Guard `_random.Random` methods with critical section API locks by using `@critical_section` AC directive
The PR is done. |
corona10
added a commit
that referenced
this issue
Nov 28, 2023
…l` builds (gh-112128) Co-authored-by: Donghee Na <donghee.na@python.org>
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
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 issue
Sep 2, 2024
…ble-gil` builds (pythongh-112128) Co-authored-by: Donghee Na <donghee.na@python.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
extension-modules
C modules in the Modules dir
topic-free-threading
type-feature
A feature request or enhancement
Feature or enhancement
random.Random
has mutable internal state. We should use the critical section API to make it thread-safe in--disable-gil
builds.For context, here is the change from the
nogil-3.12
fork. colesbury/nogil-3.12@9bf62ffc4b. Note that we want to do things a bit differently in CPython 3.13:_PyMutex mutex
inRandomObject
@critical_section
directive as the first line.nogil-3.12
, we want to push the locking "up" to the around the methods. (See the above note 2).Linked PRs
_random.Random
methods thread-safe in--disable-gil
builds #112128The text was updated successfully, but these errors were encountered: