Sys.exit() does not fully exit

Christian Heimes lists at cheimes.de
Sun Feb 17 12:04:48 EST 2008


Gary Herron wrote:
> That's a good answer.  However, it you *do* want threads, and you don't 
> want the main thread to wait for the threads to quit, you can make the 
> threads "daemon threads".  See setDaemon method on Thread objects in the 
> threading module.

In general you are right. But I don't think daemon threads are going to
solve the problem here. The threads may stop but Python may not have
returned from the system() syscall yet. In order to stop the syscall you
have to send a KILL or TERM signal to the child process. Threads and
signals don't mix well and you can get in all sorts of trouble.

Christian




More information about the Python-list mailing list