Do not release the GIL during object destruction
Discussions on Python.org
Do not release the GIL during object destruction
Currently, the GIL can be released during object deallocation, either because a C function explicitly does so, or the object has a Python __del__ method. This adds a sharp edge to reasoning about thread-safety with the GIL. I proposed not allowing context switches during object finalization to simplify the with-GIL concurrency model. This code is thread-safe with the GIL (g is a global variable) temp = fancy_object() g = (1, 2) g += (3, 4) # Expect g to be (1,2,3,4) here but this is not: te...
0 comments
No comments yet.