[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: |
Mon, 07 May 2012 08:56:54 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
On 5/5/12 11:25 PM, John Kearney wrote:
> Is there actually a guarantee that there will be 1 SIGCHLD for every
> exited process.
The manual page says, under JOB CONTROL:
Any trap on SIGCHLD is executed for each child that exits.
> Isn't it actually a race condition?
No. waitpid() returns once for each child that exits. That's why you
loop calling waitpid() when you get a SIGCHLD. It keeps returning PIDs
until there are no more unreaped children, then it returns -1.
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/
- Re: Parallelism a la make -j <n> / GNU parallel, (continued)
- Re: Parallelism a la make -j <n> / GNU parallel, Chet Ramey, 2012/05/04
- Re: Parallelism a la make -j <n> / GNU parallel, Mike Frysinger, 2012/05/05
- Re: Parallelism a la make -j <n> / GNU parallel, John Kearney, 2012/05/05
- Re: Parallelism a la make -j <n> / GNU parallel, Mike Frysinger, 2012/05/06
- Re: Parallelism a la make -j <n> / GNU parallel, John Kearney, 2012/05/06
- Re: Parallelism a la make -j <n> / GNU parallel, Mike Frysinger, 2012/05/06
- Re: Parallelism a la make -j <n> / GNU parallel, Chet Ramey, 2012/05/07
- Re: Parallelism a la make -j <n> / GNU parallel,
Chet Ramey <=
- Re: Parallelism a la make -j <n> / GNU parallel, Chet Ramey, 2012/05/07
- Re: Parallelism a la make -j <n> / GNU parallel, Mike Frysinger, 2012/05/11
Re: Parallelism a la make -j <n> / GNU parallel, Ben Pfaff, 2012/05/05
Re: Parallelism a la make -j <n> / GNU parallel, Ole Tange, 2012/05/11
Re: Parallelism a la make -j <n> / GNU parallel, Greg Wooledge, 2012/05/14