how to catch signals

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Mar 9 02:29:01 CET 2000


Quinn Dunkan wrote:
> 
> the [SIGCHLD] handler doesn't always get called, 

You can't rely on getting one SIGCHLD for every child that dies.
If another child dies before you've finished responding to the
SIGCHLD for the first one, you won't get another signal.

In the SIGCHLD handler, you need to loop calling the
non-blocking form of waitpid() until it reports no more
children to be reaped.

-- 
Greg Ewing, Computer Science Dept,
+--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-list mailing list