From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin von Loewis To: honus@cmu.edu Cc: egcs@cygnus.com Subject: Re: threadsafeness at egcs1.0.3 and 1.1 Date: Fri, 10 Jul 1998 13:32:00 -0000 Message-id: <199807102001.WAA01324@mira.isdn.cs.tu-berlin.de> References: <2353046752.900001211@DUCAT.INI.CMU.EDU> X-SW-Source: 1998-07/msg00392.html > I haven't been able to find any information of the threadsafeness of C++ > with v1.0.3. I know about the threadsafeness of the SGI STL, but what about > internal compiler issues like exceptions. Are they threadsafe? If not, > will they be in 1.1? Exception handling is not thread-safe in 1.0, it will be in 1.1 (provided you have a supported thread library on your system). There is a minor issue left: initialization of local static objects, as in int f() { static int i = get_some_value(); return i; } If two threads call f concurrently, initialization might be performed twice. Since this can be handled on the application level in many cases, it is not considered a serious problem (by some). If get_some_value produces an exception, the code that g++ emits does not conform with the standard, so this needs to be rewritten, anyway. Anybody looking into it might consider thread-safety here, as well. Regards, Martin