[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Routers Processing A Single Message



On Mon, 10 Feb 1997, Eugene Crosser wrote:
> > Just in case you didn't catch it (in retrospect I wan't very explicit), the
> > problem is that while one router process is trying to rename() (or
> > link/unlink) a file, one or more other router processes can also rename()
> > or link() it - yielding more than one router process that each think they
> > have an exclusive copy.
> 
> Sorry guys, maybe I am missing something, but I always thought that link/
> unlink/rename are all `atomic' on any normal UNIX.  So, if you renamed a
> file to something private, no one would ever be able to rename it too.
> If you are using link/unlink, you must check the result of unlink as well
> as the result of link to be safe, if unlink returned ENOENT that means that
> someone else has grabbed the file already and you should just drop your copy.

Some systems apparently do not have a rename() system call, or it may not
actually be atomic (as is apparently the case with IRIX 5.3) .

You're right about checking the unlink().  I hadn't thought about being
able to use unlink()'s atomicity to prevent a race.

Is unlink() *always* atomic though?  I heard some time ago that link() is
not properly atomic in some NFS cases (specifically, a VMS NFS server was
the one I heard about).

-Andy