[Twisted-Python] thread pool question
Benjamin.Rutt at gs.com
Thu Mar 22 14:48:59 EDT 2007
I copied the code below and ran it as:
$ cat twisted-threadpool.py
from twisted.internet import reactor
# run method in thread
reactor.callInThread(aSillyBlockingMethod, "2 seconds have
2 seconds have passed
But I note that the program never stops. I infer that least one thread
is getting set as a non-daemon thread, according to python's thread
rules on program termination:
Set the thread's daemon flag to the Boolean value DAEMONIC. This
must be called before `start()' is called.
The initial value is inherited from the creating thread.
The entire Python program exits when no active non-daemon threads
Is there a way to set this program up such that the program will exit
when all of the threads registered via callInThread, and the main
thread, have exited?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python