title: Write to text file from multiple threads?
body: <p>i have 20 threads that write with the println() function on a file called results.txt. How can i synchronize them all?</p>
  
  <p>I note every time my program run i have different number of lines of text in results.txt.</p>
  
  <p>Thank you.</p>