sokol wrote:
What was a surprise to me was that python sched.py makes the same mistake as I did in my first version.
The sched module is *not* designed for multithreading. It assumes that the thread waiting for events is the only one putting events into the queue, so it's impossible for an event to get scheduled while in the midst of a sleep. It also doesn't take any measures to protect its data structures from concurrent access. The documentation could make this clearer, especially since it confusingly talks about "allowing other threads to run". -- Greg -- http://mail.python.org/mailman/listinfo/python-list