title: Can I use a dummy lock file for PHP to implement mutual exclusion?
body: <p>I was wondering whether this is a  good way to implement mutual exclusion on PHP:
  You use PHP flock() and a dummy lock file.</p>
  
  <p>Because flock() only allows one process to access a file.</p>
  
  <pre><code>$file = fopen("dummyLockFile");
  flock($file, LOCK_EX)
  //Critical section
  fflock($file, LOCK_UN)
  fclose($file)
  </code></pre>