[Bug libstdc++/40088] Creating a std::ostringstream object locks a global mutex
veloso at verylowsodium dot com
gcc-bugzilla@gcc.gnu.org
Fri May 22 21:03:00 GMT 2009
------- Comment #9 from veloso at verylowsodium dot com 2009-05-22 21:03 -------
(In reply to comment #4)
> Hm. I wonder how the "global" locale is supposed to interact with multiple
> threads anyway (in the face of C++ not knowing about threads). Would it be
> a conforming implementation to put the global locale into thread-local storage
> (thus, having a "global" locale for each thread)?
Pre C++0x, the standard says nothing about threads at all.
The C++0x draft has this to say:
Whether there is one global locale object for the entire program or one global
locale object per thread is implementation defined. Implementations are
encouraged but not required to provide one global locale object per thread. If
there is a single global locale object for the entire program, implementations
are not required to avoid data races on it
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40088
More information about the Gcc-bugs
mailing list