title: Writing to same file at the very same time
body: <p>Ok, I know that there's been similar questions on this site about this problem, but none of this questions and provided answers isn't exactly what I need.</p>
  
  <p>I'm building flat-file based CMS. 
  What if, for example:</p>
  
  <ol>
  <li><p>2, 3, 10..... fwrite in appending mode requestes come to same php file "contact_form_messages_container.php"  at the same time?</p></li>
  <li><p>2, 3, 10..... fwrite in "w" mode requestes come to same php file which holds the simpley nubmer of specific page visits, again at the same time?</p></li>
  </ol>
  
  <p>I know about flock() function, but it could happen two or more flock() requests comes on the same time... Does anyone knows solution to this problem? Only thing I have on my mind is usleep()-ing the script using while looop for some amount of time, until the target file becomes availibile, but I do not have idea if it works, where and how to perform this? 
  Does anyone have practical expirience with this issue?
  Thanks in advance!</p>