nmh-workers
[Top] [All Lists]

[Nmh-workers] Locking (specifically, sequences)

2013-03-07 12:45:16
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:

    http://lists.nongnu.org/archive/html/nmh-workers/2012-02/msg00050.html

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?

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>