[Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16

Glyph Lefkowitz glyph at twistedmatrix.com
Mon Sep 19 15:21:34 EDT 2011


On Sep 19, 2011, at 3:02 PM, Fabian Rothfuchs wrote:

> Well no, not from multiple threads.
> I have only two threads – one main thread, which is the Django framework, and one detached 
> thread for the reactor, as the reactor itself would be blocking Django.
> 
> All Adapters are in Django, and are reaching out to the one reactor in the thread without threading themselves.
> Is this 'allowed' ?

I guess I should have said "supported", since clearly Python allows it :).

This is fine - depending very heavily what you mean by "reaching out to the one reactor".  Are they doing this reaching out via callFromThread (or something that calls it, like blockingCallFromThread)?  That is OK.  Calling reactor APIs (like connectTCP, or listenTCP, or callLater) from your Django thread will break.

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110919/c6578839/attachment.htm 


More information about the Twisted-Python mailing list