bug-bash
[Top][All Lists]
Advanced

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

Re: Parallelism a la make -j <n> / GNU parallel


From: Greg Wooledge
Subject: Re: Parallelism a la make -j <n> / GNU parallel
Date: Fri, 4 May 2012 12:44:32 -0400
User-agent: Mutt/1.4.2.3i

On Fri, May 04, 2012 at 12:41:03PM -0400, Mike Frysinger wrote:
> i wish there was a way to use `wait` that didn't block until all the pids 
> returned.  maybe a dedicated option, or a shopt to enable this, or a new 
> command.

wait takes arguments.

> for example, if i launched 10 jobs in the background, i usually want to wait 
> for the first one to exit so i can queue up another one, not wait for all of 
> them.

Do you mean "for *any* one of them", or literally "for the first one"?
The latter, you can do right now -- just pass the PID of the first one.
The former would require that you set up a SIGCHLD trap and do some work.

By the way, "help wait" is misleading; it says you can only pass a single
job ID argument.  The man page indicates that you can pass multiple
arguments.



reply via email to

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