Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Wed Feb 16 2005 03:08 am "Casper H.S. Dik" wrote in message news:421322e3$0$28994$e4fe514c@news.xs4all.nl... > "David Schwartz" writes: >>"Alexander Terekhov" wrote in message >>news:42131205.B72DB5C2@web.de... > >>> David Schwartz wrote: >>> [...] > >>>> Thread-local objects are not supposed to be shared. >>> >>> Sez who? > >> I am saying that. That is what makes them thread local. > Ah, but you're now also claiming that a thread cannot > give another thread access to a thread local variable? No, I'm not saying that. I'm saying that it is possible to implement '__thread' with these semantics. > Surely you can construct a proof that __thread variables must > be shared in a common address space? No, I cannot. > Or are you saying that you cannot assign __thread * variables > to ordinary pointer variables? I am saying that the semantics of doing so and passing the pointer to another thread are defined if and only if the implementation defines them. Nothing requires the implementation to do so. >> 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. > But many do not (I'm blissfully unaware of most thread implementation > so I only know for a fact that the Solaris implementation has no unshared > bits) My point is simply that your argument that an implementation simply cannot do this (or they aren't 'threads') is absurd. DS .