Handling threads
Blair Hall
b.hall at irl.cri.nz
Wed Aug 7 01:09:28 EDT 2002
More information about the Python-list mailing list
Wed Aug 7 01:09:28 EDT 2002
- Previous message (by thread): obj[1] *and* obj['foo']
- Next message (by thread): Handling threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have a problem with a class that uses the Thread module and starts a background thread when an object is created to do some misc stuff. My class has a 'close' method that terminates the background thread. However, the class __del__(), which calls close(), does not seem to be a satisfactory way of shutting down the thread. Actually, it is not the fault of __del__(), it is the fact that you do not seem to be able to rely on __del__() being called when an object is not needed any more. In my case, I find that even quiting the PythonWin environement is not enough to properly end the running process. I need to do Ctrl-Alt-Delete and end the PythonWin task (Windows95). Is there not a 'better' way to make my class easy to use ( it is very easy to forget to call close()! )?
- Previous message (by thread): obj[1] *and* obj['foo']
- Next message (by thread): Handling threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list