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, 2012-10-11 at 16:25 -0700, Roland McGrath wrote:
> > (wouldn't work e.g. for OpenMP though, as that keeps some threads around
> > to avoid constant pthread_create/pthread_join).
> 
> Use of any long-lived TLS data in OpenMP-annotated code seems inherently
> ill-defined for exactly that reason.  AIUI the OpenMP annotations don't
> give you any guarantee about how much parallelism you actually get, so
> using __thread or thread_local variables in such code fragments seems like
> it ought to be out of spec entirely.  Is it well-specified in some way I'm
> not thinking of?

There are some rules, including whether tasks are tied to particular
threads or not, which thread teams are generated and scuh (see Section
1.3 of the OpenMP spec).
I'm not aware of any real integration of OpenMP and TLS life-cycles as
defined by C++, for example, but I wouldn't say that it's entirely out
of the spec.

Torvald


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