[dokuwiki] Re: Proposal: FS#113, notify changes

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 25 Jun 2005 11:06:26 +0200

On Fri, 24 Jun 2005 21:06:24 -0500
Steven Danz <steven-danz@xxxxxxxxx> wrote:

> Well, I started reading and it looks like flock() doesn't sound too 
> reliable, and
> more so in my case as -everything- here runs over NFS.  From looking
> at the comments
> on Zend, it almost sounds like file locking in general might need some
> 
> review thanks
> to file caching issues and new multi-threaded Apache servers. I'm 
> looking over
>         http://us2.php.net/manual/en/function.flock.php
> now for some ideas.  Let me know what you think.

From the above page:

  file locking with PHP over NFS shares simply does not work. Any
  attempt to use it will fail under any race condition.
  The only atomic file operation which is usable over NFS is mkdir()
  which will either create a folder or return a error status...
  So on NFS servers, forget flock(), use @mkdir()

So you could use mkdir to create a "lock file". I suggest to do this in a 
special lockfile directory instead doing it directly in the datadir. I'd like 
to move the lists of subscribed users out of the datadir, too.

I'll post another mail about that in a minute.

Andi

Other related posts: