Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] history locking with fcntl
- X-seq: zsh-workers 24834
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: [PATCH] history locking with fcntl
- Date: Fri, 18 Apr 2008 02:49:42 +0200
- In-reply-to: <080417065834.ZM9193@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080415153120.GE1223@xxxxxxxxxxxxxxxxxxx> <20080417104054.295003e3@news01> <080417065834.ZM9193@xxxxxxxxxxxxxxxxxxxxxx>
On 2008-04-17 06:58:34 -0700, Bart Schaefer wrote:
> On Apr 17, 10:40am, Peter Stephenson wrote:
> } pindex(HIST_FCNTL_LOCK)
> } provide better performance, in particular avoiding history corruption when
> } files are stored on NFS.
>
> Really? Traditionally fcntl() has been a lousy way to lock over NFS.
AFAIK, it's the only way to prevent some corruption due to file caching.
> Procmail, for example, has acres of code to handle using secondary
> files as semaphores precisely because nothing else was reliable over
> NFS
But procmail *also* uses fcntl. My patch still uses the old lock
mechanism, it just adds fcntl locking. That said, I often use fcntl
only, without any problem.
> (more specifically, only creat() was guaranteed to be atomic and
> lock daemons were flaky).
Some software, like Firefox, uses symlink() locking. So, if symlink()
isn't atomic, there will be problems with such software.
> I guess my point is that while fcntl() may be good on recent OSs (or
> recent versions of NFS, more likely) it's dangerous in an environment
> where you don't know what the NFS server is using (no matter how recent
> the local NFS client is).
I don't see why it can be dangerous if it is used in addition to
another lock mechanism, like it currently is.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author