Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Tue Feb 15 2005 10:47 am "Alexander Terekhov" wrote in message news:4211CDC9.A5CF3C5F@web.de... >> describe here. Each thread has different memory mapped to the same >> address (don't try to take the address of an __thread variable though). > > Why so? Because there are two different ways to implement __thread, and the semantics of taking the address of a thread local variable are different in the two cases. One implementation does the magic in the address taking. Each thread will get a different address for the thread local variable. Another implementation does the magic in the page mapping. Each thread gets the same address for the thread local variable, but a different page is mapped into that address in each thread. Unless you know for sure which implementation you have and are willing to break on a different implementation, or your are using the address only in a way which is safe under either implementation, you can get results other than you expected. DS .