title: Is it thread safe to call printf in threads that run simultaneously?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/467938/stdout-thread-safe-in-c-on-linux">stdout thread-safe in C on Linux?</a>  </p>
  </blockquote>
  
  
  
  <p>Say thread1 and thread2 are similar and at the end of their jobs they both printf. Is it thread safe or do they have to lock printf somehow?</p>
  
  <p>Is it related to stdout? What if one does fflush(stdout) after each printf? Does it change anything?</p>