Encapsulating Locked File Appends

dsimcha dsimcha at yahoo.com
Tue Mar 10 12:37:10 PDT 2009


== Quote from BCS (ao at pathlink.com)'s article
> Reply to Andrei,
> > NFS is as non-deterministic as it gets when it comes about concurrent
> > writes. There is next to no guarantee. The append problem is an
> > absolute classic on NFS. I tried about five different schemes, all
> > failed under mysterious circumstances. What I do now and suggest you
> > do too is to have each different process create its own file. After
> > all processes have ended, have a master process assemble all small
> > files into one. It's really the only thing I got to work.
> >
> > Andrei
> >
> IIRC there is a lockd process on most NFS systems. I think it does something
> for this issue but I don't know what.

Thanks, but ideally I'd like to do this in a way that it doesn't _have_ to be NFS,
since this is a general problem I have and only this instance is on NFS.  Ideally,
I'd like to write a generic function called lockedAppend that works on both Linux
and Windows and is filesystem agnostic.  As far as I can tell, this is close to
impossible, so maybe I'm better off having all my processes write to separate
files.  There is no reason why they absolutely _have_ to all write to the same
file, it would just be more convenient if they did.



More information about the Digitalmars-d mailing list