osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Const access to CPython objects outside of GIL?


Op 17 jul. 2018 om 09:40 heeft Radim ?eh??ek <radim at rare-technologies.com> het volgende geschreven:

> 
> 
> To be honest, I did do some CPython source code staring already. And at least for the functions we care about, it wasn't all that painful (PyDict_GetItem being the trickiest). Doing this wholesale might be a superhuman task, but I'm thinking a practical subset could be relatively straightforward while still useful, 80/20.

This is would likely lead to a fairly vague document.  Using PyDict_GetItem as an example, even if it might sometimes be possible to call without holding the GIL there are definitely use cases where it is not, for example when there are keys with a type implemented in python, or when the dict is modified in another thread. 

Ronald