Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : David Schwartz Date : Thu Feb 24 2005 02:32 pm "Marcin 'Qrczak' Kowalczyk" wrote in message news:87wtsxr8ca.fsf@qrnik.zagroda... > "David Schwartz" writes: >> Why? The pthreads standard is absolutely clear and not in error. The >> C++ >> ABI is absolute clear and not in error. The problem is strictly in G++, >> which doesn't turn the locking off when the programmer specifically >> indicates that he has locked all cases where data may be shared (implied >> by >> '-pthreads'). > The problem is in the lack of a common C++/POSIX standard which would > clearly say that static local initializers are thread-safe. The term 'thread-safe' assumes that you already lock any situation where data might be modified in one thread while it's accessed in another. Otherwise, almost no function is thread-safe. With or without this option, static initializers are thread-safe. This is *NOT* a thread safety issue. DS .