[Twisted-Python] deferToThread and thread pool

I have a few questions about the default implementation of deferToThread.
1. Does deferToThread use a thread pool by default? If not, how can I enable this?
2. Which thread are the callbacks and errbacks of the deferred returned by deferToThread run in?
Thanks in advance!
Brian

On 8/31/05, Brian Granger bgranger@scu.edu wrote:
I have a few questions about the default implementation of deferToThread.
- Does deferToThread use a thread pool by default? If not, how can
I enable this?
Yes
- Which thread are the callbacks and errbacks of the deferred
returned by deferToThread run in?
The reactor (i.e., probably the main) thread.

On Tue, Aug 30, 2005 at 09:17:10PM -0700, Brian Granger wrote:
I have a few questions about the default implementation of deferToThread.
- Does deferToThread use a thread pool by default? If not, how can
I enable this?
Yes. You can adjust the threadpool size using reactor.suggestThreadPoolSize:
http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.I... http://twistedmatrix.com/projects/core/documentation/howto/threading.html#au...
- Which thread are the callbacks and errbacks of the deferred
returned by deferToThread run in?
The main thread, i.e. the reactor thread.
-Andrew.
participants (3)
-
Andrew Bennetts
-
Brian Granger
-
Christopher Armstrong