Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Gianni Mariani Date : Wed Feb 16 2005 09:00 pm Alexander Terekhov wrote: > Gianni Mariani wrote: > > [... struggling SGI ...] > > Quoting SGI's docu: > > ---- > For programs under the IRIX 5.3 and above, segments with the > PF_MIPS_LOCAL flag set will be thread-local and not shared in > the event of an sproc(2) system call. IRIX 5.3 is 10 years old. > > [...] > > The sproc model of threading is incompatible with POSIX threads. > Attempts to create an sproc process from a pthreaded program will > be rejected [see pthreads(5)]. > ---- > > Contrast it with {less struggling} Intel's* docu (C/C++ ABI): > > ---- > Address-of operator > > The address-of operator, &, can be applied to a thread-local > variable. This operator is evaluated at runtime, and returns > the address of the variable within the current thread. The > address obtained by this operator may be used freely by any > thread in the process as long as the thread that evaluated > the address remains in existence. When a thread terminates, > any pointers to thread-local variables in that thread become > invalid. > ---- > > And, BTW, see also > I don't know why you're so hung up about this issue. What are the merits of making thread locals slow vs some arbitrary issue with POSIX threads conformance ? It's not as if anyone here is representing the __thread extension is conforming in any way whatsoever. I would prefer that speed of implementation is preferred over some unimportant rule here, that's the whole point, isn't it ? .