[Twisted-Python] deferToThread crashing on Windows, stable on Linux

Chris Mellon arkanes at gmail.com
Thu Aug 30 12:39:42 EDT 2007

On 8/30/07, Allen Bierbaum <abierbaum at gmail.com> wrote:
> I have run into an interesting little bug and before I try to hunt it
> down further I wanted to check and see if anyone else has seen
> anything similar.
> I have a fairly complex twisted 2.5 application that uses
> deferToThread to spawn off worker threads that need to call some
> blocking non-twisted code (query webserver, query database, etc).  The
> application uses these workers quite a bit but there are normally
> never more then 2 or 3 outstanding requests running.
> The application runs rock-solid on Linux, but it crashes in less then
> a minute on Windows.
> Has anyone else seen anything like this?  Are there any known issues
> of deferToThread being less stable on Windows then Linux or are their
> any differences between how twisted works on the platforms that I
> should be looking into?
> -Allen

I use deferToThread heavily for the same thing on Windows and haven't
seen any crashes. I would double and triple check the threadsafety of
the APIs you are calling.

More information about the Twisted-Python mailing list