How to tell if a forked process is done?

Klaus Alexander Seistrup spam at magnetic-ink.dk
Wed Sep 24 18:30:36 EDT 2003


Christos TZOTZIOY Georgiou wrote:

> if you are not root and you are sure that your own processes
> do not breed like rabbits, then you can be almost sure that
> os.kill(pid, 0) will throw an EPERM if your child has died.

That's too many ifs to my taste.

Your own processes needn't breed like rabbits - other's processes
can breed like rabbits, too, and if you're unlucky, your next
spawn will have the same pid as a previous process of yours.

Anyway you look at it, killing blindly is bad programming practice.


  // Klaus

-- 
 ><> 	unselfish actions pay back better




More information about the Python-list mailing list