Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Fri Feb 04 2005 11:25 am Alexander Terekhov writes: > The thing is that not all local statics are immutable If they are mutable, then operations which change them need synchronization *in adition to* initialization. > and/or need thread-safe init provided by implementation to > begin with. If they are initialized lazily and this may happen from multiple thread simultaneously, then synchronization is needed. Otherwise it's harmless. If you don't want lazy initialization with its overhead (an overhead of checking whether it's initialized is present even without threads), just move the variable outside the function - it will be initialized on program startup. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .