Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Thu Feb 10 2005 05:18 pm gniccolai@yahoo.com (Giancarlo Niccolai) writes: >> It guards the object during its initialization. > > No. It guards object initialization, which includes some data locking. It's a matter of the point of view. > It's not a question of poor mapping, because you may wish to have some > threads accessing part of a class and part of another with the same > mutex constraints; This is not a problem with synchronized semantics of static locals - you can always add an explicit lock for a larger group of objects. OTOH concurrently initializing two parts of the same object is not supported - neither with synchronized semantics nor with unsynchronized one. You have still not shown what will break under the synchronized semantics. And this is because nothing will break that wasn't already broken. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .