Message317273
> the old TLS API is only available if PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT.
PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is defined on most (pthread) platforms, no? I understood that the PEP 539 is mostly designed for Cygwin, a platform which is not officially supported by Python. At least, PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is set to 1 on my Fedora 27 (Linux).
I propose to cast pthread_key_create() result to int, but only define PyThread_create_key() in Python/thread_pthread.h if PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is defined.
It means that the pthread implementation of Python would still have this bug (race condition) if PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is not defined. But backporting the PEP 539 to Python 2.7 doesn't seem worth it.
What do you think? |
|
Date |
User |
Action |
Args |
2018-05-22 13:02:13 | vstinner | set | recipients:
+ vstinner, petr.viktorin, neologix, matrixise, davin, cstratak, Ján Stanček, Thomas Mortensson |
2018-05-22 13:02:13 | vstinner | set | messageid: <1526994133.56.0.682650639539.issue29640@psf.upfronthosting.co.za> |
2018-05-22 13:02:13 | vstinner | link | issue29640 messages |
2018-05-22 13:02:13 | vstinner | create | |
|