bug-bash
[Top][All Lists]
Advanced

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

Re: multi-threaded compiling


From: Robert Elz
Subject: Re: multi-threaded compiling
Date: Tue, 12 Mar 2024 17:23:12 +0700

    Date:        Tue, 12 Mar 2024 18:32:19 +1000
    From:        Martin D Kealey <martin@kurahaupo.gen.nz>
    Message-ID:  
<CAN_U6MXCx2GnC2eyXVAo3zsSmVrOuDODKHEU_y9LmFktjbq8jQ@mail.gmail.com>

  | You don't need '-n' when you specify a PID; the fix is simply to remove it.

That's OK, when there is exactly one PID, but for a task like this,

        wait -n -p pid PID1 PID2 PID3 ...

would be a better invocation, to wait for whichever of the list finishes
first.   Still doesn't get around the bash idiocy though (for which there
is a very simple solution, I think, which I suggested to Chet off list a
while ago).

In a more realistic application, where the tasks all take longer than
the script takes to start them, and get to the point of waiting, solutions
using -n would mostly work, even in bash.   It just fails when the tasks
have finished before "wait -n" is performed (or if they are killed by a
signal).

kre





reply via email to

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