Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : gniccolai Date : Sat Feb 19 2005 02:40 pm Alexander Terekhov wrote in message news:<4217611A.44A9AED5@web.de>... > 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. WHAT? THEY HAVE ALREADY DONE IT? Ok, I am going to write them. Who's the guilty? Bye, Gian. .