[Python-Dev] Slides from today's parallel/async Python talk

Stefan Ring stefanrin at gmail.com
Thu Mar 14 20:59:57 CET 2013


>     Yup, in fact, if I hadn't come up with the __read[gf]sword() trick,
>     my only other option would have been TLS (or the GetCurrentThreadId
>     /pthread_self() approach in the presentation).  TLS is fantastic,
>     and it's definitely an intrinsic part of the solution (the "Y" part
>     of "if we're a parallel thread, do Y"), but it definitely more
>     costly than a simple FS/GS register read.

I think you should be able to just take the address of a static
__thread variable to achieve the same thing in a more portable way.


More information about the Python-Dev mailing list