10.23.07

cout thread safety

Posted in Blogroll at 8:38 pm by kevincw01

Came across this today and thought it was post-worthy:

I would expect any program that uses cout in more than one thread,
without locking, to fail in random ways. A deadlock or crash means
you got lucky, because by the specs in that case it’s allowed to
erase your disk and impregnate your sister.

I found it here in a discussion of using cout from concurrent threads.

Leave a Comment