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

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to