On 3/8/11 1:32 PM, Eric Blake wrote:

> Really, the only safe way to handle things like SIGHUP cleanup is to
> have the signal handler record that an exception occurred, then have the
> main processing loop checking that variable frequently enough to do
> cleanup in a reasonable time-frame (possibly by using a pipe-to-self if
> the main loop is waiting on select()), where the main loop then
> re-raises the signal after doing cleanup at a point where all functions
> are safe.

And here we are back at the same place we were this morning.  That didn't
take too long this time.

To recap: that's what happens for the most part, but there are places in
the code where it's inconvenient or not possible to break out of what
you're doing, and you have to terminate immediately to avoid complaints
of non-responsiveness.  One of those places is a blocking read(2).  That's
where I have to look next.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to