-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-109693: Update _gil_runtime_state.locked to use pyatomic.h #110836
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
Conversation
corona10
commented
Oct 13, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Clean-up pyatomic headers #109693
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.
@colesbury: Do you want to review pyatomic.h changes?
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.
Windows logs many compiler warnings, see: https://github.com/python/cpython/pull/110836/files
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.
Can you also add a test to Modules/_testcapi/pyatomic.c
for the new functions?
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.
Two more comments I missed in the first pass. When you get everything working to your satisfaction, I'd suggest testing the PR on all the buildbots as there is some platforms specific code.
Got it |
Convert to the draft PR since I need to check many things. |
You can use |
@colesbury @vstinner So can you please take a look? |
_Py_atomic_store_int_release(int *obj, int value) | ||
{ | ||
#if defined(_M_X64) || defined(_M_IX86) | ||
*(int volatile *)obj = value; |
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.
@colesbury
Basically, int volatile * and volatile int* have the same meaning.
So I just follow the convention from _Py_atomic_load_ptr_acquire
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 @vstinner , let's wait @colesbury too :) |