[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] Locking (specifically, sequences)

From: Ken Hornstein
Subject: [Nmh-workers] Locking (specifically, sequences)
Date: Thu, 07 Mar 2013 13:42:50 -0500

Greetings all,

David Levine has taken the lead on documenting the MH folder format, and
the results of that are available in mh-folder(5).  Thanks, David!

Upon reading it, I have realized that this brings to the forefront some
of my gripes with nmh locking.  I've touched on this before, but I don't
think there is a reason why mail spool locking should be conflated with
every other kind of locking.

Admittedly, MH/nmh wasn't designed this way ... the locking was primarily
around for the spool file, and the same functions were used to lock other
things (Paul Vixie wrote the code that we incorporated that did
locking for sequences and the context file).  So it's long overdue that
we revisit some of this.

Obviously locking on the spool file should match whatever locking the
local delivery agent uses.  But let's look at the "everything else" case.

Lyndon makes the case here:


That the default should be "flock".  The more I research it ... the more
confused I've become.  fcntl() locks have the unhappy behaviour (as
Lyndon notes) that any close of a descriptor holding a fcntl() lock
will remove the lock (even if there are other descriptors open that
for the same lock).  lockf() does record locking, but cannot do a shared
lock.  flock() is not part of POSIX, but it seems like everyone that I
checked supports it.

So ... suggestions?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]