intermachine flocking

Uri Guttman uri at
Tue Dec 13 16:50:41 GMT 2005

>>>>> "SW" == Simon Wistow <simon at> writes:

  SW> We have a farm of machines which will have access to a file. We only 
  SW> want one of the machines accessing that file at once - if a process 
  SW> cannot get a lock on the file then it should exit immediately otherwise 
  SW> it shoudl write the necessary number of times to the file and then exit.

  SW> Of course flock() doesn't work across NFS. Is the only solution to this 
  SW> a flock daemon?

mkdir works as an atomic (advisory) lock over nfs. the perl cookbook 1st
ed. has a recipe i studied and rewrote for my needs. the only issue is
possible left over locks after a reboot and those can be cleaned up with
a startup script.


Uri Guttman  ------  uri at  --------
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------

More information about the mailing list