fork() and wait()

Donn Cave donn at drizzle.com
Thu Oct 17 02:13:43 EDT 2002


Quoth aahz at pythoncraft.com (Aahz):
| In article <Xns92A79ACF1551Fnmoasypcamimswebcom at 165.112.130.8>,
| Chuck May  <NmOaSyPcAM at imsweb.com> wrote:
|>
|> It appears that this code works, but I am concerned about the timing.  
|> In the main loop, I am concerned that a job would finish before the 
|> os.wait() call.  Does anyone know if there is a "safer" method of 
|> achieving this goal?
|
| Use twisted to spawn off several child processes, then use a queue of
| some kind to feed work to those processes.
|
| http://www.twistedmatrix.com/

Chuck, they're playing with you.  If you can explain the question
you're asking better, there's a chance you will get the answer
you're looking for.  I'll say this about the code you posted -
don't fork like that without an exception handler at the top of
the child process.  It is never good when the child process jumps
back to a handler in code the parent is supposed to be running.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list