[Bug c++/13487] New: Construction of local static objects is not thread-safe

rmerkert at alphatech dot com gcc-bugzilla@gcc.gnu.org
Thu Dec 25 03:21:00 GMT 2003


I've just recently run into this particular problem (see original PR 7458). It
was my understanding that compiling gcc with the enable-threads option would
provide a certain level of thread safety within C++ code (not just for exception
handling). 

This topic has been briefly discussed in the mailing list:
http://gcc.gnu.org/ml/gcc/2002-08/msg00274.html 
and Mark Mitchell stated that there is no real performance overhead to
implementing this. 

Anyway, I think this should be implemented unless there is a really good reason
for not doing it. Or at least a warning maybe that code using static local
objects is not threadsafe?

-- 
           Summary: Construction of local static objects is not thread-safe
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rmerkert at alphatech dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13487



More information about the Gcc-bugs mailing list