[Twisted-Python] stop conditions and deferToThread()
screwtape at froup.com
Wed Jun 10 07:43:21 EDT 2009
I'm not sure this is the problem you're facing, but...
On Wed, Jun 10, 2009 at 12:04:16PM +0200, Thomas Jakobsen wrote:
> import time
> from twisted.internet import reactor
> from twisted.internet.threads import deferToThread
> running = True
> def foo():
> while running:
> print "working"
> def bar():
> print "stopping"
> running = False
> d1 = deferToThread(foo)
> d2 = deferToThread(bar)
...does that make things run better?
More information about the Twisted-Python