Open colesbury opened 1 week ago
Hi @nitzmahone - I'm still working through the CFFI free-threading issues, but I figured it'd be helpful to get some feedback on a small change.
On that note:
PyDict_GetItemRef
, but that sort of thing is nicely provided. by https://github.com/python/pythoncapi-compat/. Would you be interested in using that?init_once_cache
have the same lifetime as its FFIObject instead of lazily initializing it. I went with the smaller code change for now, but let me know what you think.To find thread-safety issues, in addition to reading through the code, I'm using https://github.com/Quansight-Labs/pytest-run-parallel, which I've found to be very effective.
Lock the FFI object when initializing the init_once_cache dictionary and use PyDict_GetItemRef in places where the dictionary's value may be concurrently modified.
See #126