Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Wed Feb 16 2005 04:00 am "Alexander Terekhov" wrote in message news:42132E79.BB79F8C6@web.de... > David Schwartz wrote: >> 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, > Objects with __thread storage duration are no more "thread-private" > than objects with automatic storage duration (auto stuff). What standard requires this? > IOW, they > are NOT thread-private. Doing it otherwise is utterly brain-dead. You have said this, but not explained why. It should be obvious that for the vast majority of cases, what you are claiming is required is not required. Further, in most cases, it results in dramatically reduced performance. http://docs.biostat.wustl.edu/cgi-bin/info2html?(gcc.info.gz)C99%2520Thread-Local%2520Edits Notice no mention of share memory in the definition of threads. Notice no discussion of the semantics of taking the address of a thread-local variable. DS .