[Twisted-Python] Has anybody integrated multiple threadpools into reactor?
andrew-twisted at puzzling.org
Thu Oct 21 14:14:21 EDT 2004
On Thu, Oct 21, 2004 at 01:35:43PM -0400, Glyph Lefkowitz wrote:
> On Thu, 2004-10-21 at 06:31, Andrew Bennetts wrote:
> > There's nothing in Twisted that requires all your threads run in a Twisted
> > threadpool; they're just provided for convenience (mainly the convenience of
> > deferToThread). If all you need is a single thread, then
> > t = threading.Thread(target=foo)
> > works great. reactor.callFromThread works from any thread.
> I mostly agree with your post, but when is your suggestion not
> equivalent to:
When other things are using the threadpool.
It's possible that e.g. 20 other long-running callInThreads have been made.
With the default threadpool settings, this means this foo wouldn't get run
for a long time.
Of course, if you have 20 threads, you may have other issues ;)
Oh, and using threading.Thread directly allows you to make that thread
daemonic, if you want.
So they're practically the same. :)
More information about the Twisted-Python