[Twisted-Python] Minor question wrt threading pools

Mike C. Fletcher mcfletch at rogers.com
Fri Apr 16 21:26:24 MDT 2004


I'm sitting down to move more of our application into Twisted and have 
come across a minor question that I'm thinking would be a good addition 
to the threading howto.

In particular, starting a thread-pool seems to start the threads as 
non-daemon threads, so that on completion of the main reactor loop the 
threads are still hanging around (AFAICS, anyway, the app sits hung 
waiting for the background threads to complete).

It would be useful to know:

    * How to start threads in the threading pool as daemon threads (i.e.
      will exit when all non-daemon threads exit)
    * How to force an exit of all threads
          o How to access the currently active thread-pool (I assume the
            documented ThreadPool.stop method is what needs to be
            called, but how to get the ThreadPool object isn't
            documented AFAICS).

Anyway, it's not a show-stopper, I can just kill the app manually after 
each test run, still, would love to have an answer.  Have fun,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/






More information about the Twisted-Python mailing list