Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Wed Jan 19 2005 09:29 am "David Schwartz" writes: >> IMHO if the compiler supports threads, it should act as if it >> implemented a hypothetical extended C++ standard with threads. >> A reasonable semantics of static variables in functions in >> multithreaded C++ would require locking. > > 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. Static (and extern) variables outside functions, initialized at the beginning of the program, are another story with different problems. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .