waste of resources ?
Arne Mueller
a.mueller at icrf.icnet.uk
Tue Jun 8 09:58:03 EDT 1999
Hi All,
>
> Another thing to note is that when a child process dies the parent
> will be sent a SIGCHLD signal (I think this also applies if the child
> process was paused with SIGSTOP). If you just want to ignore the
> return code of the child process, use code like this:
>
> import signal
> import os
>
> def sigchild_handler(signum, frame):
> os.wait()
>
> signal.signal(signal.SIGCHLD, sigchild_handler)
>
> This will run os.wait for each child process that exits. You will
> need to catch the return value of os.wait and inspect it if you care
> what the process returned or whether it was killed by a signal.
>
Hm, that doesn't work properly with my program. THe number of zombie
processes is steadily at about 20, which means there are 20 unhandled
died children.
Arne
More information about the Python-list
mailing list