waste of resources ?

Greg Ewing greg.ewing at compaq.com
Fri Jun 11 03:24:53 CEST 1999

Arne Mueller wrote:
>                     chfds.remove(i)
>                     os.waitpid(chpids[i], os.WNOHANG)
>                     del chpids[i]

If you're explicitly waiting for a particular child,
*don't* use WNOHANG, because you *want* to block until
that child has exited -- which it may not have done
yet, even though it has written its data.

> I mean maybe ther child exits when the parent
> hasn't reached the os.waitpid?

Other way around -- the parent can reach the waitpid
before the child has exited.


More information about the Python-list mailing list