This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug libstdc++/40088] Creating a std::ostringstream object locks a global mutex



------- 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


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