canceling and joining threads

sir_alex chimaera29 at libero.it
Mon Dec 19 06:46:32 EST 2005


Hello everybody! I have a couple of questions about threads: the first
is, is there the possibility to cancel a thread while it is executing
(like the C function thread_cancel), for implementing something like an
"abort" button? And the second is, i have a GUI in which there's a
button that launches a thread implemented using the threading module
(creating a class which inherits from threading.Thread and overriding
__init__ and run), i chose to use threads to avoid the problem of
freezing my windows, but after i call classobject.start() this happens:
if i then call classobject.join(), then the button is freezed, because
now the button waits the end of the thread, if i don't make this call
the button releases itself (that is a good behavior) but the thread
freezes until i give a ctrl-c in the console from which i launched my
app. So, how can i make my button release while the thread is
executing? (my GUI is implemented in GTK and i use libglade) (sorry for
the length of this post...)




More information about the Python-list mailing list