title: File I/O slowing down my C loop
body: <p>I have a C program that does "stuff" in a loop, where each iteration is timed to some hertz. This loop used to be able to run at about 80k hz.</p>
  
  <p>Then I added some file I/O to the loop (reading/writing to linux file descriptors) and now it seems that I can't break ~6k loops/sec. The operations themselves are very cheap, so I suspect it's some kind of kernel context switch that is causing a bunch of latency. So, two questions:</p>
  
  <ul>
  <li>how do I check if this is the case?</li>
  <li>is there anything I can do about it, apart from RT-patching my kernel?</li>
  </ul>