This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: threadsafeness at egcs1.0.3 and 1.1


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]