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: Chet Ramey
Subject: Re: Parallelism a la make -j <n> / GNU parallel
Date: Fri, 04 May 2012 16:17:02 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/4/12 2:53 PM, Mike Frysinger wrote:

> it might be a little racy (wrt checking cnt >= 10 and then doing a wait), but 
> this is good enough for some things.  it does lose visibility into which pids 
> are live vs reaped, and their exit status, but i more often don't care about 
> that ...

What version of bash did you test this on?  Bash-4.0 is a little different
in how it treats the SIGCHLD trap.

Would it be useful for bash to set a shell variable to the PID of the just-
reaped process that caused the SIGCHLD trap?  That way you could keep an
array of PIDs and, if you wanted, use that variable to keep track of live
and dead children.

Chet
- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+kOT4ACgkQu1hp8GTqdKs0iACfdXujLn96piuZGbJaIVu22TZ0
x/EAoIZo01MQJTCsEGvU0zmDghEEPjrA
=DOKm
-----END PGP SIGNATURE-----



reply via email to

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