title: Are standard output streams in C++ thread-safe (cout, cerr, clog)?
body: <p>I know that there is no concept of threads in current <code>C++</code>, but <a href="http://www.ddj.com/article/printableArticle.jhtml;jsessionid=S3H2MMECMYOUFQE1GHPCKH4ATMY32JVN?articleID=201804215&amp;dept_url=/cpp/" rel="noreferrer">this article is saying</a>:</p>
  
  <blockquote>
    <p><strong>A typesafe, threadsafe, portable</strong>
    <strong>logging mechanism</strong></p>
    
    <p>.....</p>
    
    <p>The <code>fprintf()</code> function is threadsafe,
    so even if this log is used from
    different threads, the output lines
    won't be scrambled.</p>
  </blockquote>
  
  <p>What about <code>cout</code>, <code>cerr</code> and <code>clog</code>?</p>
  
  <p>I think this question is applicable to all kind of stream types in C++ also, like <code>fstream</code> and <code>stringstream</code>.</p>