"Roy T. Fielding" wrote:
>
> > > And why does each worker grab a mutex before checking the pipe of death?
> > > All that a worker does is check to see if there is a character on the
> > > pipe and, if so, it tells all of the workers to exit. So why does it
> > > matter if more than one worker gets inside that exclusion zone? *shrug*
> >
> > yet another good question. I'll take a crack at it:
> >
> > when the parent decides to shut down or restart, it writes one character
> > per process on the PoD. If multiple worker threads within a given
> > process are allowed to each eat a character, some other process may not
> > be woken up . This stall only occurs under very light loads (e.g.
> > developers running tests).
>
> Wouldn't the same result be achieved by simply closing the pipe for
> writing? Then when the children attempt to read they get an EOF,
> regardless of how many attempt the read. This is assuming that the
> parent opens a unique pipe of death per graceful restart, which
> seems to be the case.
>
hmmmm...sounds reasonable, and sounds like less code too. Code that's
not there can't break, and can't eat CPU either. I like it!
Greg (who hasn't checked the unique pipe of death per restart situation)