[Twisted-Python] Question about processes in python

David Ripton dripton at ripton.net
Mon Apr 12 12:06:37 EDT 2010

On 2010.04.12 09:39:21 -0600, Jason J. W. Williams wrote:
> Haven't had any issues yet. Twisted imports occur inside the process
> function. The app was originally written as a purely blocking
> multiprocessing app and rewritten to use Twisted inside the
> sub-processes. It's passed all automated and hand tests without an
> issue. Is there a reason importing Twisted inside sub-process should
> not work?

Here's JP's canonical answer:


I've seen this problem in real code.  We had a PyGTK + Twisted program
that erroneously used subprocess in one place.  2% of the time, it
caused an exception.  98% of the time, it worked fine.  Classic race
condition.  Could be you have a similar bug but it never actually
manifests on your combination of code, OS, and hardware.  Hard to say.

David Ripton    dripton at ripton.net

More information about the Twisted-Python mailing list