Zombies from forked thread process. Why?

Dave Cinege dcinege at psychosis.com
Thu Aug 16 15:56:15 EDT 2001


Mats Wichmann wrote:
> 
> On Wed, 15 Aug 2001 11:53:01 -0400, Dave Cinege
> <dcinege at psychosis.com> wrote:
> 
> :Linux 2.4, Debian 2.2/Redhat 7.1 Python 2.1.1 compiled from source.
> :
> :I have a daemon process that watches a directory for files. When
> :some appear it decides what to do with them and then spawns a
> :processor to handle them. To be speedy it detaches (forks) a processor
> :for each 'section'. Eveything run perfect, except that when the processor
> :process returns it leaves a zombie in the process tree:
> 
> Zombies are processes that have completed processing, but whose parent
> has not yet collected their exit status.  Your program  needs to
> "wait" for them to collect the status.

Ahh yes of course.  Hmm, well I don't want to wait for them.
I want to spawn a thread that fork's several processes, and then
have the thread return not caring about the return state of the
children. Might this work by ignoring SIGCHLD, or am I going to need
to double fork it off with a dummy wait process??

Dave




More information about the Python-list mailing list