title: Is putStrLn thread-safe?
body: <p>I know that if I have multiple threads calling <code>putStrLn</code> without any kind of concurrency control that the output of the threads may be interleaved.</p>
  
  <p>My question is whether <code>putStrLn</code> is thread-safe modulo this interleaved output?</p>
  
  <p>I am presuming that <code>putStrLn</code> is a buffered write operation, so I'm really asking if any corruption of the output buffer can occur by having two threads call <code>putStrLn</code> at the same time.</p>
  
  <p>And in general, what can be said about the thread safety of Haskell's (really GHC's) other "standard I/O" functions? In particular, for any of the buffered read operations is it possible for the same character to get returned to two different threads making the same read call at the same time?</p>