Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 6, 1:32 pm, rdmur...@bitdance.com wrote: > Darren Dale wrote: > >On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > >> En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale > >> escribi : > > >> > On Mar 5, 12:02 pm, s...@pobox.com wrote: > >> >> What happens if you simply call > > >> >>    my_thr

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread rdmurray
Darren Dale wrote: >On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: >> En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale >> escribi�: >> >> > On Mar 5, 12:02�pm, s...@pobox.com wrote: >> >> What happens if you simply call >> >> >>my_thread.setDaemon(True) >> >> >> (or in Python 2.6): >> >>

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale   > escribió: > > > > > On Mar 5, 12:02 pm, s...@pobox.com wrote: > >> What happens if you simply call > > >>     my_thread.setDaemon(True) > > >> (or in Python 2.6): > > >>     my_thread.daemon = True

Re: question about ctrl-d and atexit with threads

2009-03-06 Thread Darren Dale
On Mar 5, 6:27 pm, "Gabriel Genellina" wrote: > En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale   > escribió: > > > > > On Mar 5, 12:02 pm, s...@pobox.com wrote: > >> What happens if you simply call > > >>     my_thread.setDaemon(True) > > >> (or in Python 2.6): > > >>     my_thread.daemon = True

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Gabriel Genellina
En Thu, 05 Mar 2009 15:26:18 -0200, Darren Dale escribió: On Mar 5, 12:02 pm, s...@pobox.com wrote: What happens if you simply call     my_thread.setDaemon(True) (or in Python 2.6):     my_thread.daemon = True ?  That is the documented way to exit worker threads when you want the applica

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
On Mar 5, 12:02 pm, s...@pobox.com wrote: > What happens if you simply call > >     my_thread.setDaemon(True) > > (or in Python 2.6): > >     my_thread.daemon = True > > ?  That is the documented way to exit worker threads when you want the > application to exit.  From the threading module docs: >

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread skip
What happens if you simply call my_thread.setDaemon(True) (or in Python 2.6): my_thread.daemon = True ? That is the documented way to exit worker threads when you want the application to exit. From the threading module docs: "The entire Python program exits when no alive non-daem

Re: question about ctrl-d and atexit with threads

2009-03-05 Thread Darren Dale
Actually, this problem can also be seen by running this code as a script, it hangs up if the sys.exit lines are commented, and exits normally if uncommented. import atexit import threading import time class MyThread(threading.Thread): def __init__(self): threading.Thread.__init__(se