[Twisted-Python] Using reactor with multiple processes

James Y Knight foom at fuhm.net
Wed Sep 16 18:29:24 EDT 2009

On Sep 16, 2009, at 12:33 PM, David Yoakley wrote:
> Thanks Phil for the reference to ampoule.   We will look at that  
> next.  We are still hoping to get the parent set up in such a way  
> that whatever the forking :-) shared state is, it does not get  
> established until after the children are spawed. I'll post back  
> later with what we find.  Phil your thoughts on this would also be  
> appreciated.

It think it would be a nice for this to work. Importing (but not  
running) twisted should ideally not cause strange side effects.

So if this turns out to be a problem with some twisted-internal code  
rather than your code, a bug report would be a good idea, and a patch  
causing such problematic setup to be done at reactor startup rather  
than import time even better.

That should at least fix the case of forking before starting the  
reactor. For people who want to fork while the reactor is running,  
there would need to be API for clearing out all the timed events, open  
sockets, etc and starting over. Which is probably more trouble than  
it's worth.


More information about the Twisted-Python mailing list