[Twisted-Python] Re: twisted application server
p.mayers at imperial.ac.uk
Fri Mar 7 13:30:46 EST 2008
Mike Pelletier wrote:
> On Fri, Mar 7, 2008 at 8:36 AM, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
>> If you fork a python interpreter, you should very quickly replace the
>> process with exec.
> Does fork+exec have any advantages over spawn?
If you mean "os.spawnXX" I think that, under Unix, those *are* fork &
exec, so no - they're identical.
I don't think there's a native unix syscall "spawn".
Seems I recall there is something in the MS VC runtime named similar.
Anyway - if we're talking about Twisted, you want to use the Twisted
support - reactor.spawnProcess and a subclass of t.i.p.ProcessProtocol
to talk to the child worker.
reactor.spawnProcess does the right thing(tm)
More information about the Twisted-Python