On 2020-03-24 16:31, Mark Shannon wrote:
Hi,

As an experiment, I thought I would try moving the thread state (what you get from _PyThreadState_GET() ) to TLS.

https://github.com/python/cpython/compare/master...markshannon:threadstate_in_tls

It works, passing all the tests, and seems sound.

It is a small patch (< 50 lines) and doesn't increase the overall code size.

My branch is GCC/Clang only, so will need a bit of extra code for Windows. It should only need a few more lines; I haven't done it as I don't have a Windows machine to test it on.

What about other compilers?

AFAIK, __thread is a a non-standard name for a C11+ feature. Is there a good way to do this in C99?
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ER5FMM2ZDSK2CT7OMDLFPIGIDKG4YHPJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to