Subj : Re: Is std::cerr thread safe To : comp.programming.threads From : robertwessel2@yahoo.com Date : Wed Jul 20 2005 09:14 pm Sean Kelly wrote: > Maciej Sobczak wrote: > > Sean Kelly wrote: > > > > > The STL is guaranteed to be thread-safe > > > > No, it isn't (and cerr is not STL). > > > > It is rather considered to be a Quality of Implementation issue (you > > will not find it in the standard) that the program at least does not > > crash when I/O is accessed in a MT way. > > I actually meant that the guarantee is merely that standard library > components will compile and operate in a multithreaded environment, > though I admit that this seems fairly self-apparent. In my experience, > this mostly means that mutable global statics are either not used or > that access to them is serialized. Is this also a QOI issue? I'll > admit I haven't read the standard very closely in this regard. The C++ standard says nothing about threads at all. It's a QoI issue in that you would hope that a thread aware C++ implementation would provide at least semi-reasonable non-fatal behavior for streams in the presence of threads, but nothing in the standard compels it to. .