[Python-Dev] pthreads question: typedef ??? pthread_t and hacky return statements
Greg Stein
gstein@lyra.org
Thu, 17 Aug 2000 16:41:37 -0700
On Wed, Aug 16, 2000 at 11:34:12PM -0400, Tim Peters wrote:
>...
> So one of two things can be done:
>
> 1. Bite the bullet and do it correctly. For example, maintain a static
> dict mapping the native pthread_self() return value to Python ints,
> and return the latter as Python's thread.get_ident() value. Much
> better would to implement a x-platform thread-local storage
> abstraction, and use that to hold a Python-int ident value.
>
> 2. Continue in the tradition already established <wink>, and #ifdef the
> snot out of it for Monterey.
>
> In favor of #2, the code is already so hosed that making it hosier won't be
> a significant relative increase in its inherent hosiness.
The x-plat thread-local storage idea is the best thing to do. That will be
needed for some of the free-threading work in Python.
IOW, an x-plat TLS is going to be done at some point. If you need it now,
then please do it now. That will help us immeasurably in the long run.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/