UNIX question

Art Zemon zemon at fritz.UUCP
Tue Dec 10 11:36:45 AEST 1985


In article <156 at uw-june> pjs at uw-june (Philip J. Schneider) writes:
>
>
>I have a C program which, during the course of its execution, spawns(forks)
>child processes. I should mention that a process is spawned, it lives
>for a while, then exits, and then sometime later the same thing happens,
>and so on.  This all happens within the lifetime of the parent, and I
>would like to do this an arbitrary number of times.  Sometimes, two or
>more child processes exist at once, but the upper limit on child
>processes that exist concurrently is low, and a group of such children
>exit before the next process begins.
>
>Since UNIX only allows one a certain number of processes at a time,
>eventually during the course of execution of the parent I run out of
>processes.  If I temporarily stop the parent process execution and
>do a 'ps', the child processes show up in the list with a 'Z' status.
>They do not completely disappear until the parent process exits.  As some
>of you probably already know, these useless ex-processes can't even
>be completely gotten rid of with a 'kill' command.  The result is that
>these processes are taking up my process quota, even though they are
>dead in all practical terms (in that they finished their work and exited
>properly).  Of course, they do go away completely once the parent exits.

The child processes have gone away properly and are waiting for
someone (some process) to collect their exit statuses with a
wait() or a wait3().  They cannot be kill()-ed because they are
already dead.

They go away after the parent exits because init inherits them
and does enough wait()s to get rid of all of them.
-- 
	-- Art Zemon
	   FileNet Corp.
	   ...! {decvax, ihnp4, ucbvax} !trwrb!felix!zemon



More information about the Comp.unix.wizards mailing list