You cannot call any Twisted functions from a thread, with the exception ^^^^^^^^^^^^^ Er, I guess I should have worded this more carefully. What I meant is: you cannot call any Twisted functions from a different thread to the one the reactor is running in, which includes any thread created with deferToThread.
of callFromThread; so this would probably be pretty pointless.
I am not sure I understood this: suppose my message sending loop simply loops over client protocol instances and calls transport.write(some_message) Why cannot I call this loop in a thread from the main reactor loop to have it non-blocking in case this sending loop is giant (over 1000s of clients)? I do not care when this sending loop is finished, I just do not want this to slow down the main reactor loop. With 50 clients this is obviously unnecessary.
-----Original Message----- From: twisted-python-bounces@twistedmatrix.com [mailto:twisted-python- bounces@twistedmatrix.com] On Behalf Of Tristan Seligmann Sent: Saturday, December 01, 2007 6:57 PM To: twisted-python@twistedmatrix.com Subject: Re: [Twisted-Python] Advise for heavy concurrency
* Tristan Seligmann <mithrandi@mithrandi.za.net> [2007-12-02 04:50:44 +0200]:
* Atilla <theatilla@gmail.com> [2007-12-02 00:37:47 +0100]:
When it comes to deferToThread - is that actually going to be of any use? Do I get an advantage of running the "send" loop in a seperate thread? What if, say, I never had to send more than 10-50 messages, so
You cannot call any Twisted functions from a thread, with the exception ^^^^^^^^^^^^^ Er, I guess I should have worded this more carefully. What I meant is: you cannot call any Twisted functions from a different thread to the one the reactor is running in, which includes any thread created with deferToThread.
of callFromThread; so this would probably be pretty pointless. -- mithrandi, i Ainil en-Balandor, a faer Ambar