pthread_key_create and friends

Robert Collins
Mon Mar 19 01:53:00 GMT 2001

I have a working implementation of pthread_key_create,
pthread_key_delete, pthread_getspecific and pthread_setspecific.

I'm using Tls index entries (as they are a precise match for the
functionality needed).. the problem is there are only 64 available for
each process under win32 (until windows 2000).

I note that 3/4 index entries are used by existing code in cygwin...

my question is, how many is a reasonable number to allocate for
pthreads? (The spec requires a #define to be set, which we won't want to
change very often.) My code will return error codes if all the slots are
used, but it would be better to avoid using all the slots..

For my test code I've set the max amount of indexs avaliable to
pthread_key functions at 32 - is 28 remaining index entries to few for
future expansion? We should allow as many as possible for the
pthread_key functions...


More information about the Cygwin-developers mailing list