This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: threadsafeness at egcs1.0.3 and 1.1
- To: honus at cmu dot edu
- Subject: Re: threadsafeness at egcs1.0.3 and 1.1
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Fri, 10 Jul 1998 22:01:51 +0200
- CC: egcs at cygnus dot com
- References: <2353046752.900001211@DUCAT.INI.CMU.EDU>
> 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