On Fri, 29 Jan 2021 18:15:37 +0100 Victor Stinner <[email protected]> wrote: > Hi Mark, > > I tried to use C11 _Thread_local (Thread Local Storage, TLS) only with > GCC and clang and I got issues on macOS: > https://github.com/python/cpython/pull/23976 > > My PR uses __thread if _Thread_local is not available. > > I don't think that MSC (Visual Studio) implements C11 _Thread_local, > but it provides __declspec(thread). I tried it and I got issues with > DLL. I didn't dig into this issue. MSC loves C++ but seems stuck at > C99 (I'm not even sure if it's fully implemented). > > It seems like declaring a TLS in libpython and using it from an > extension module (another dynamic library) is causing issues depending > on the linker. It "should" work on macOS, but it doesn't.
You can hide the access behind a function call. Slightly more costly, but shouldn't be that expensive on modern machines. Regards Antoine. _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/DSRLQLP6CT4TKTKL5UKS4LGDDFAKNMQ6/ Code of Conduct: http://python.org/psf/codeofconduct/
