Re: Stopping a Thread with Time Slicing

2008-10-03 Thread Steve
Hi Todd, Thanks for your suggestions on using the Event condition methods on this thread. Here is my updated code : import time import datetime import threading def log(message): now = datetime.datetime.now().strftime("%H:%M:%S") print "%s : %s" % (now, message) class StoppableThrea

Re: Stopping a Thread with Time Slicing

2008-10-02 Thread Todd Whiteman
Steve wrote: Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set t

Stopping a Thread with Time Slicing

2008-10-02 Thread Steve
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set the semaphore fl