Re: [RESEND][RFC PATCH v2] waitfd

Davide Libenzi
2009-01-10T23:14:20Z

On Sat, 10 Jan 2009, Oleg Nesterov wrote:

> > Thus:
> >
> > - child process #1 dies
> > - main loop woken up by SIGCHLD
> > - pending status of signal cleared
> > - enter wait loop
> > - child process #2 dies
> > - SIGCHLD pending again
> > - waitpid() called first time, child process #1 reaped
> > - waitpid() called second time, child process #2 reaped
> > (SIGCHLD still pending)
> > - waitpid() called third time, no child processes remain
> > - exit wait loop
> > - back to top of main loop, immediately woken up by pending SIGCHLD
> > - pending status of signal cleared
> > - enter wait loop
> > - waitpid() called first time, but no child processes remain
> > (we reaped it last time round)
> > - exit wait loop
> > - back to top of main loop, sleep
>
> Scott, I don't really understand why are you trying to explain this
> all to me. I do understand this. At least I hope ;)

Indeed :)
Scott, you're teaching Linux signals to the guy that is likely the
de-facto mantainer of the subsystem. See the irony?

- Davide