title: how to write to file in an multithreaded environment
body: <p>I have a program that runs on multithread but all of them need to save results to same text file</p>
  
  <p>I get access violation error</p>
  
  <p>how can i avoid doing that</p>