Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Wed Feb 16 2005 03:10 am "Alexander Terekhov" wrote in message news:42132303.64B4747@web.de... > David Schwartz wrote: > [...] >> I am saying that. That is what makes them thread local. > The mappings are local. Objects are not. That is one implementation. It is not the only implementation. There will always have to be restrictions on passing the address of thread-local variables between threads because the implementation manages their lifetime. What those restrictions are can certainly vary, > [...] >> That's ridiculous. Providing no strictly-conforming code can tell the >> difference, POSIX is silent. And strictly conforming POSIX code can't use >> the '__thread' specifier. > Sure it is extension and no "strictly-conforming code" can use. But > extensions are not supposed to break the model, only extend it. That's not an argument. Either way, it's an extension. >> In any event, many implementations have at least one page that is not >> shared by all the threads. This is a common way to, for example, tell >> which >> thread you are. > The stuff on those pages isn't addressable by C/POSIX object > addresses. It's irrelevant implementation detail. Neither are variables that use '__thread' since '__thread' is not defined by C or POSIX. The requirement you claim exists simply does not exist. So it is impossible for an implementation to violate it. DS .