nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] Locking In Scripts and nmh Locking


From: norm
Subject: Re: [Nmh-workers] Locking In Scripts and nmh Locking
Date: Fri, 27 Apr 2012 13:48:19 -0700

Ken Hornstein <address@hidden> writes:
>>The basic philosophy and reason-for-existence of mh and of nmh is that that's
>>not the way to go. I should be allowed -- nay encouraged -- to use file system
>>tools to manipulate mh constructs.
>
>Okay, let me put in my $0.02:
>
>- I'm kinda with David Levine in that manipulating the MH files directly
>is a sort of "Here be Dragons" kind of thing.
>- But I also believe that if you want to hang yourself then you should
>be allowed to buy the rope.
>
>So, given that ... I'm fine with some kind of locking program.  I
>see this as a distinct issue from the "cron jobs modify the MH
>context" problem; Ralph has already shown a reasonable soution for
>that.  My thinking is that you would use this program only for
>fiddling with MH files outside of MH programs.  It would NOT be for
>running one or more MH commands inside of a lock.  E.g., something
>like:
>
>mhlock pick -seq ...
>
>would deadlock.
>
>So, here's a usage I'm thinking of:
>
>mhlock [-seq] [-context] [-folder foldername] [-all] [--] command
>
>The -seq, -context, -folder switches would control what it would lock.
>-all would lock all things.  mhlock would then run the command specified
>on the command line under the lock, then exit.

To make sure I understand this, I will discuss only the the -all case, which is
all I asked for. (There would appear to be complex interactions between the
other cases; it would hurt my brain to understand them.)

Is this how

     mhlock -all -- command

would work?

     command is not executed until no other 'mhlock -all' is running, and until
     no relevant nmh program is running. While command is running no other
     mhlock -all runs nor does any relevant nmh program run. When several
     'mhlock -all's and/or relevant nmh programs are contending, there is no
     guarantee about which will run first. The exit status of mhlock would be
     that of command.

Maybe? there should be --noblock and --block arguments with --block the
default?? If --noblock then command runs immediately or mhlock exits with a
special value for its exit status.

Maybe? [-seq] [-context] [-folder foldername] is overkill??

    Norman Shapiro



reply via email to

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