Fix free-threaded Python 3.14t compilation and thread safety#89
Fix free-threaded Python 3.14t compilation and thread safety#89jensens merged 4 commits intozopefoundation:masterfrom
Conversation
Replace direct ob_refcnt struct access with Py_REFCNT() macro. Guard the im_self mutation optimization with #ifndef Py_GIL_DISABLED since mutating a shared method object is not thread-safe.
davisagli
left a comment
There was a problem hiding this comment.
The C change LGTM.
Still needs to be updated with zopefoundation/meta#389
updated |
|
updated zope meta again |
dataflake
left a comment
There was a problem hiding this comment.
I'll just add this as a comment: I have zero knowledge of those C bits. But the rest LGTM...
Making it work for FT is mostly about using macros/apis for specific GIL related tasks, like reference counting and avoiding to rely on the GIL for thread safety, most chnages are straight forward:
Full Info: https://docs.python.org/3.14/howto/free-threading-extensions.html |
dataflake
left a comment
There was a problem hiding this comment.
I'm going to approve this now because there seems no progress at all from the other reviewers.
I looked at the C changes and from eyeballing it those seem to make sense.
callable->ob_refcntwithPy_REFCNT(callable)macroim_selfmutation optimization with#ifndef Py_GIL_DISABLED(not thread-safe without GIL).meta.tomlFixes #88