[Twisted-Python] Minor question wrt threading pools

Itamar Shtull-Trauring itamar at itamarst.org
Fri Apr 16 23:40:20 MDT 2004


On Fri, 2004-04-16 at 23:26, Mike C. Fletcher wrote:

>     * How to start threads in the threading pool as daemon threads (i.e.
>       will exit when all non-daemon threads exit)

I've seen python core dump when this is done (python 2.0 IIRC, but I'm
still *very* wary of doing it). I wouldn't if I were you :)

>     * How to force an exit of all threads

They exit automatically when program ends, i.e. you do reactor.stop() -
unless they are doing something, in which case they will exit when they
next try to read next task from queue. Your problem may be because you
are doing tests and thus reactor.stop() is neveer called and it thus
never shuts down the threadpool for you.

-- 
Itamar Shtull-Trauring    http://itamarst.org
Looking for a job -- http://itamarst.org/resume.html





More information about the Twisted-Python mailing list