This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/40088] Creating a std::ostringstream object locks a global mutex
- From: "veloso at verylowsodium dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2009 21:03:06 -0000
- Subject: [Bug libstdc++/40088] Creating a std::ostringstream object locks a global mutex
- References: <bug-40088-17695@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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