-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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-111924: Use PyMutex for runtime global locks. #112207
Conversation
This replaces some usages of PyThread_type_lock with PyMutex, which does not require memory allocation to initialize.
@ericsnowcurrently, when you get a chance, would you please review this?
|
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.
mostly LGTM
I've left a few very minor comments.
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
I've left one comment that I'll leave to your discretion. I'll wait for your response before merging.
Thanks for tackling this, @colesbury! |
This replaces some usages of PyThread_type_lock with PyMutex, which does not require memory allocation to initialize. This simplifies some of the runtime initialization and is also one step towards avoiding changing the default raw memory allocator during initialize/finalization, which can be non-thread-safe in some circumstances.
This replaces some usages of PyThread_type_lock with PyMutex, which does not require memory allocation to initialize. This simplifies some of the runtime initialization and is also one step towards avoiding changing the default raw memory allocator during initialize/finalization, which can be non-thread-safe in some circumstances.
…GH-127866) This PR fixes the build issue introduced by the commit 628f6eb from GH-112207 on systems without thread local support.
…upport (pythonGH-127866) This PR fixes the build issue introduced by the commit 628f6eb from pythonGH-112207 on systems without thread local support. (cherry picked from commit f823910) Co-authored-by: velemas <10437413+velemas@users.noreply.github.com>
…upport (pythonGH-127866) This PR fixes the build issue introduced by the commit 628f6eb from pythonGH-112207 on systems without thread local support.
This replaces some usages of
PyThread_type_lock
withPyMutex
, which does not require memory allocation to initialize.This simplifies some of the runtime initialization and is also one step towards avoiding changing the default raw memory allocator during initialize/finalization, which can be non-thread-safe in some circumstances.