title: non blocking write to file in c/c++
body: <p>I'm writing a logging program, and I need to read from serial once a second then print to a log file. 
  The problem is that sometimes, something is holding up my loop and data is getting backed up. After timing every activity in my loop, I noticed that the function that prints my data to the log file is the one taking up too much time sometimes. I was looking into non-blocking write to file, and according to this post:</p>
  
  <p><a href="https://stackoverflow.com/questions/3050621/file-writing-with-overlapped-io-vs-file-writing-in-a-separate-thread">File writing with overlapped IO vs file writing in a separate thread</a></p>
  
  <p>The "write to files" should not be blocking my program by default. But it seems like they are. </p>
  
  <p>I'm using MS visual studio EX and I'm writing a consol c++ app. Can someone tell me if <code>fprintf</code> and <code>&lt;&lt;</code> are supposed to be non-blocking/asynchronous by default? If not, is there a way to make them so?</p>