This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH glibc] pthread_setspecific: Provide signal-safety across keys


On Thu, 19 Oct 2017, Florian Weimer wrote:

> > musl implements it: you just have to allocate tls for
> > all dsos and all threads in dlopen and pthread_create.
> > (if unbounded dlopen/dlclose calls are supported then
> > it's a bit trickier since dtv slots need to be reused
> > then, but should be possible in principle)
> 
> We have received guidance that this is not desirable for all TLS usage
> scenarios.  Some applications might not want to allocate backing storage for
> the full set of TLS variables for those threads which do not need all of them.

My assertion is that the default, for new binaries, should be to do the 
allocation at dlopen / pthread_create time.  This allows for the 
possibility of having a dlopen flag / pthread attribute / other API to 
allow lazy allocation in a particular case, with new symbol versions being 
used to keep existing binaries defaulting to lazy allocation.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]