title: Mutual Exclusion Without Touching Both Processes
body: <p>I have a unique problem. There are two processes (P0 and P1) trying to access one file. P0 is writing information to the file and P1 is reading the information. There is a race condition occurring between the two in which P1 is reading before P0 is finished writing. I have considered using Locks, Semaphores, etc. However, P1 exists in a set of code that I am not allowed to alter in any way, and it currently has no implementation to support the above proposed fixes.</p>
  
  <p>Is there any way to remove this race condition without touching both sets of code?</p>