UNIX question

Philip J. Schneider pjs at uw-june
Fri Dec 6 10:38:33 AEST 1985



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.

I can certainly understand why one is allowed only a limited number of
active processes at any time.  My processes, however, are not at all
active once they have exited, and I feel that once a process exits,
I should have my quota "credited" so that I can get more.

Clearly, my problem is how to get around this situation.  I could
(possibly) get a higher limit on my process quota, but this would
only mean that running out of processes will happen a little later.

My question: Is there any way to kill off these zombies so I can get
	     more processes ?  Or, failing that, is there any other
	     way to do what I want ?


Please respond by e-mail if you can help at all, or if you need more
details.  Thanks in advance.
-- 

  Philip Schneider                               
  University of Washington Computer Science                
  pjs@{uw-june.arpa,washington.arpa}                      
  {ihnp4,decvax,cornell}!uw-beaver!uw-june!pjs           



More information about the Comp.unix.wizards mailing list