Subj : Re: Is std::cerr thread safe To : comp.programming.threads From : Sean Kelly Date : Wed Jul 20 2005 01:04 pm The STL is guaranteed to be thread-safe, but thread safety in this case just means that it won't crash horribly if you use it in a multi-threaded program. In my experience, writing to std::cerr from multiple threads works just fine, but the elements may be intermixed if writes are simultaneous. A fairly cheap way around this is to do every write into a stringstream and then dump it en masse into the error stream: std::ostringstream ostr; ostr << "error: " << errno << '\n'; std::cerr << ostr.rdbuf(); The preferable alternative would be to wrap writes in a critical section or create your own error stream that does something like using thread local storage for its buffer and only flushes when explicitly instructed to do so. Sean .