This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Thread safety of cout
- From: Dan Evison <devison at pacificit dot co dot nz>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 08 Oct 2004 05:03:29 +1300
- Subject: Thread safety of cout
Hi,
Is it safe to have multiple threads writing to cout without any additional
locking?
My program is getting into deadlock sometimes, it seems while writing to
cout. I'm running gcc 3.2.1, on linux kernel 2.4.24. I have a gdb trace of
each thread if that helps.
I can't seem to find a consistent message about this on the web. This link
seemed to suggest to me that it would be safe on linux, though perhaps I
misread that:
http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#9
thanks,
Dan Evison