Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Alexander Terekhov Date : Sat Feb 19 2005 04:54 pm Marcin 'Qrczak' Kowalczyk wrote: [...] > It can be turned off, but not because it might not work (it doesn't > break correct programs): "Most users should leave this alone, > but embedded programmers may want to disable this by specifying > -fno-threadsafe-statics for a small savings in code size." It saves not only code size. Useless syncronization is expensive and shall be avoided as a matter of principle (apart from its negative impact on performance). That's why making all static locals synchronized "just in case" is totally brain-dead. They should have provided a pragma, attribute, keyword, or something like that to control it on per instance bases. regards, alexander. .