From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 18 Dec 2006 14:23:30 -0500 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] wait hang In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Topicbox-Message-UUID: f65e7ac4-ead1-11e9-9d60-3106f5b1d025 You're right again. The "wait" command will work correctly -- it won't return until all children have finished. What might not work is waiting for a particular pid. That is, if you do something like sleep 1000000 & pids=() for(i in `{seq 200}){ echo foo >/dev/null & pids=($pids $apid) } for(p in $pids) wait $p then since the kernel tosses away some of the wait records, the first wait $p for a tossed-away record will just loop calling wait and never getting the expected record. It will not give up because there is still the one child (sleep 1000000) left. I'm not really convinced this part of rc ever worked right to begin with, so this is no big loss. Plain "wait", with no argument, does work correctly now. Russ