better scheduler with correct sleep times

Scott David Daniels Scott.Daniels at Acm.Org
Sun Oct 19 14:05:00 EDT 2008


Scott David Daniels wrote:
> def time_server(commands):
>     '''Process all scheduled operations that arrive on queue commands'''
>     ...
> 
> queue = Queue.Queue()
> thread.thread.start_new_thread(queue)
 > queue.put((time.time() + dt, callable, args, {}))
 > ...

And of course of the three lines that were not cut and pasted, one
was mis-transcribed.
It should have read:
     thread.start_new_thread(time_server, (queue,))

Sheepishly,
--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list