I might be totally off here, but are you using NFS by any chance? According
to some posts I’ve read on comp.unix.solaris, flock is just plain busted on
NFS.
Regards,
Dan
···
-----Original Message-----
From: Joel VanderWerf [mailto:vjoel@PATH.Berkeley.EDU]
Joel VanderWerf wrote:File.read($path)
I should have pointed out that the File.read call (within the lock
context) is necessary to the problem. I wonder if that gives up the
lock? Because doing the following immediately after the read seems to
fix the problem:f.flock(File::LOCK_EX)
So this suggests that file locks are nestable on linux but not on
solaris. The man pages say that solaris flock is implemented
in terms of
fcntl, so maybe that’s where the semantic difference comes from…I wonder if there is a way ruby can insulate us from this difference?