Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Wed Jan 19 2005 12:23 pm "Marcin 'Qrczak' Kowalczyk" wrote in message news:87fz0xbz53.fsf@qrnik.zagroda... >> Lock what exactly? How should the compiler know what the constructor >> might conflict with and what locks might be appropriate? > I mean static variables in functions, which are initialized when the > function is run for the first time. I'm still baffled. > Static (and extern) variables outside functions, initialized at the > beginning of the program, are another story with different problems. Okay, but what should be locked? Are you suggesting that every single construction of a static object should be treated as if it were bracketed by a lock/unlock pair of a single global mutex? DS .