Can someone please comment on this? From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Liu Shuai Hi all, I am aware that similar and probably same questions have
been posted many times, but I was unable to find a solution after reading a
dozen threads in the archive. So here it goes again. I have a thread that does some heavy task (hash calculation,
for instance). I need a mechanism that works *across
platforms* to stop that calculation if user decides to exit. How can
I do that? I can not do the standard “periodical checking”
way since there is only one function/step call in my thread. Here is a snippet of my thread classes to help illustrate
the problem: class Dispatcher(): def
__init__(self):
self.__worker = Worker() def start(self):
self.__worker.start() def stop():
#how do i stop the worker? class Worker(threading.Thread): def __init__(self): def run(self):
oneTimeConsumingCall() Thank you in advance for any suggestions/pointers. LS |
-- http://mail.python.org/mailman/listinfo/python-list