fork, exec no wait
robertcdio at my-deja.com
robertcdio at my-deja.com
Fri Feb 2 14:19:20 EST 2001
Heres the deal:
a process vfork/execs a child
child does stuff1 while...
parent runs stuff2 (without waiting for child to finish)
*But* upon completion of child, i want the parent to switch to stuff3
simple right?
well here is the problem i cant find a way for the rent to know that
there little guy is done... could call wait or waitpid but both of
those stall the parents process... i looked at some early versions of
system(function) and thought i was on to something because i cam
across the wait command embedded in a while loop with no body than i
thought well perhaps the wait command doesnt actually wait at all but
is stalled by the while loop so i dropped stuff2 into the body of the
while loop... allas this didn't work. So i had a smoke...
then i thought well if the child is done its pid goes away so i figured
well thats simple i just nest a call to get the childs pid into a while
loop so that the parent routinely checks for the childs expected pid.
hmm the parent can't talk to the child only the child can talk to the
parent... am i right wrong confused in the wrong proffecion? HELP
I know i should be a writer check out the run on sentences!!! Kudos to
the brilliance that aids me(and bring anti perspirant)!
Sent via Deja.com
http://www.deja.com/
More information about the Python-list
mailing list