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: [PATCH] Destructor support for C++11 thread_local variables


On Thu, Oct 11, 2012 at 03:53:40PM -0700, Richard Henderson wrote:
> On 10/11/2012 03:17 PM, Roland McGrath wrote:
> >> One must construct all of the tls variables from a translation unit at
> >> the same time.
> > 
> > Is that a semantic requirement?  Is there a special technical reason for
> > it, or just "principle of least astonishment" for people who write
> > constructors with side effects?
> 
> Semantic requirement of c++11.

Though, I still wonder how is that implementable.  Because a TU could have
say 3 thread_local vars with ctors/dtors, and the middle one of them could
call in the constructor some function that accesses thread_local with
ctors/dtors of some other TU, then you have just partially initialized the
current TU and need to initialize another TU (and it is unclear in what
order they need to be destructed).

	Jakub


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