Problem with running external process

Dan Sommers me at privacy.net
Mon Jan 23 09:04:43 EST 2006


On 23 Jan 2006 04:33:17 -0800,
"ToMasz" <t_mo_info at o2.pl> wrote:

> ...  how much should I increase these values to allow infinite
> executions of external process?

That sounds like a bad idea.  Long before you've run an infinite number
of processes, a real resource will be exhausted.

You are probably creating zombie processes (you can check with /bin/ps).
To get rid of them, execute os.waitpid(-1, os.WNOHANG) (or something
similar to that) periodically from within your python script.  Possibly
execute that statement repeatedly until it indicates that there are no
more zombies.  A good time/place to do this is right before you start
another process.

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>



More information about the Python-list mailing list