Ken wrote:

> So Lyndon pointed out to me in private email that on BSD systems we
> should be using flock for locking.  (Specifically, the mail spool on
> those systems uses flock).  But this made me realize that locking in
> nmh is a big mess.

Not just in nmh.  This is old but looks useful:

https://bugzilla.mozilla.org/show_bug.cgi?id=239013#c9

> I think we can divide locking into two categories - the mail spool, and
> everything else.  "Everything else" includes annotations, the context,
> sequences, and the MIME content cache.  It occurs to me that it probably
> doesn't matter which locking method we use for that as long as it's
> consistent inside of nmh.  I think that should be the "best" locking
> available, which would be one of flock/lockf/fcntl.
>
> As for the mail spool ... well, I am wondering if that should be
> runtime configurable.  My thinking is that most people seem to be
> using prebuilt packages and what makes sense on one system might
> not make sense on another, so maybe runtime selection would be
> better.  Right now we default to dot locking unless you override
> it, and that seems wrong to me.

I agree.  How about this:  default to flock on FreeBSD,
fcntl on Linux, and so on for the platforms we know.

For platforms we don't know, use dot locking.  Or to really
play it safe, have configure determine which are available
and use them all?

David

_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to