[issue3710] Reference leak in thread._local

Antoine Pitrou report at bugs.python.org
Thu Aug 28 02:38:01 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

> But then if there is a context switch during the last Py_XDECREF, then
> it could be the case that self->dict is not set properly on return from
> _ldict().

Well, C code is effectively locked in a single thread until the GIL is
released. It means that a piece of C code which doesn't release the GIL
behaves as a critical section. So the only thing to consider, IMO, is
whether the GIL can still be released between "if (ldict == NULL)" and
"self->dict = ldict".

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3710>
_______________________________________


More information about the Python-bugs-list mailing list