This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Ján Stanček, Thomas Mortensson, cstratak, davin, matrixise, neologix, petr.viktorin, vstinner
Date 2018-05-22.13:02:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526994133.56.0.682650639539.issue29640@psf.upfronthosting.co.za>
In-reply-to
Content
> 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?
History
Date User Action Args
2018-05-22 13:02:13vstinnersetrecipients: + vstinner, petr.viktorin, neologix, matrixise, davin, cstratak, Ján Stanček, Thomas Mortensson
2018-05-22 13:02:13vstinnersetmessageid: <1526994133.56.0.682650639539.issue29640@psf.upfronthosting.co.za>
2018-05-22 13:02:13vstinnerlinkissue29640 messages
2018-05-22 13:02:13vstinnercreate