title: Safe access to file from two processes
body: <p>Suppose I have two processes. One always resides in memory and periodically reads some settings from a file on a disk. If it detects that settings was changed then it applies them.</p>
  
  <p>The other process runs under command line by demand and modifies the settings. Thus the first process only read the file and never write to it while the second can only write to the file.</p>
  
  <p>Should I synchronize the access to the file to ensure that the first process will always get consistent settings i.e. before or after modifications not some intermediate contents? If yes, what is the simplest way to do this in C++.</p>
  
  <p>I'm interested mainly in cross-platform ways. But also curious about Windows- and/or Linux-specific ones.</p>