Describe the bug
Cython uses _PyObject_GetDictPtr in __Pyx_PyObject_GetMethod and reads the dict pointer directly. In free-threading the dict pointer is stored atomically as such it will lead to data races when dict is changed concurrently on the object.
|
dictptr = _PyObject_GetDictPtr(obj); |
Code to reproduce the behaviour:
No response
Expected behaviour
No data races
OS
Linux
Python version
3.14
Cython version
main
Additional context
See _PyObject_SetManagedDict in CPython for the use of atomic for setting the dict.