waste of resources ?

Greg Ewing greg.ewing at compaq.com
Thu Jun 10 21:24:53 EDT 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.

Greg




More information about the Python-list mailing list