The file locking mechanism in PHP makes processes queue up for their locks by default
<? $fp = fopen("foo.txt", "w"); if (flock($fp, LOCK_EX)) { print "Got lock!\n"; sleep(10); flock($fp, LOCK_UN); } ?>