Repository navigation
Clean-up pyatomic headers #109693
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement3.13only security fixesonly security fixes
on Sep 21, 2023 - added a commit that references this issue
on Sep 21, 2023 - added a commit that references this issue
on Sep 21, 2023 @vstinner, For
pycore_atomic.h, I'm not sure whether to keep_Py_atomic_addressand_Py_atomic_intor not.I was fine to remove pycore_atomic_funcs.h at once since it's only used by _PyUnicode_FromId() which is... no longer used by Python itself!
To remove pycore_atomic.h, I would prefer to make baby steps: convert usage one by one. For example, you can start by converting signal handlers: get_handler() and set_handler() in Modules/signalmodule.c, and also the two "tripped" variables.
If someone goes wrong, it would be easier to revert changes if they have limited scope. Also, smaller PRs are easier to review :-)
Reacted by Sam Gross@colesbury @vstinner
I am working on the following fields.cpython/Include/internal/pycore_gil.h
Lines 28 to 31 in 67e8d41
_Py_atomic_address last_holder; /* Whether the GIL is already taken (-1 if uninitialized). This is atomic because it can be read without any lock taken in ceval.c. */ _Py_atomic_int locked; - added 4 commits that reference this issue
on Oct 10, 2023 8 remaining items
- added a commit that references this issue
on Oct 17, 2023 @colesbury @vstinner I think that now we can close this issue.
Please let me know if you want to reopen this issue :)Reacted by Sam GrossThanks @corona10!
Reacted by Donghee NaWell done. One less legacy API in Python C API :-)
Reacted by Maurice and Eric Snow- added 7 commits that reference this issue
on Sep 2, 2024
Feature or enhancement
Now that #108337 is done, we have three atomic headers. We should be able to remove
pycore_atomic.handpycore_atomic_funcs.hand replace their usages with calls topyatomic.h.cc @vstinner
Linked PRs