On Mon Dec 18 11:49:41 EST 2006, [EMAIL PROTECTED] wrote:
> You're right. I forgot about "wait".
> I reverted the change to rc.
>
> Note that if you add "wait" to your hanging example
> it will not necessarily wait for all of the echos, only
> the first 128 or so.
>
> Russ
if i'm reading pwait correctly, it will actually wait for all if them because
nwait
is now properly incremented and decremented, but the wait message will be
discarded if the waitlist is >= 128 when the child exits.
do i have this wrong?
- erik
from port/proc.c
1195 lock(&up->exl);
1196 if(up->nchild == 0 && up->waitq == 0) {
1197 unlock(&up->exl);
1198 error(Enochild);
1199 }
1200 unlock(&up->exl);
1201
1202 sleep(&up->waitr, haswaitq, up);
1203
1204 lock(&up->exl);
1205 wq = up->waitq;
1206 up->waitq = wq->next;
1207 up->nwait--;
1208 unlock(&up->exl);
1209
1210 qunlock(&up->qwaitr);
1211 poperror();
1212
1213 if(w)
1214 memmove(w, &wq->w, sizeof(Waitmsg));