[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

STINNER Victor report at bugs.python.org
Tue Jan 9 11:21:41 EST 2018


STINNER Victor <victor.stinner at gmail.com> added the comment:

Python 3 is not affected by this issue because it uses native thread locale storage (TLS):

* pthread: pthread_getspecific() / pthread_setspecific()
* Windows: TlsGetValue() / TlsSetValue()

I'm not sure that it's doable to backport such enhancement, since Python 2.7 supports many thread implementations, not only NT (Windows) and pthread:

* Python/thread_atheos.h
* Python/thread_beos.h
* Python/thread_cthread.h
* Python/thread_lwp.h
* Python/thread_nt.h
* Python/thread_os2.h
* Python/thread_pth.h
* Python/thread_pthread.h
* Python/thread_sgi.h
* Python/thread_solaris.h
* Python/thread_wince.h

Maybe it's doable for a Linux vendor, but it's going to be a large change that has to be maintained downstream :-/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29640>
_______________________________________


More information about the Python-bugs-list mailing list