Threading.Event w/ timeout veeeeeery slow on win32?

Greg Copeland gtcopeland at earthlink.net
Fri Jul 13 03:55:13 CEST 2001


Ville Vainio <vvainio at karhu.tp.spt.fi> writes:

> cliechti at mails.ch (chris liechti) writes:
> 
> > what is the timeout value?
> > i've had problems with time.sleep() when using values smaller than 20ms 
> > (0.02). I'm now using 30ms wich works fine.
> 
> Several seconds. I suppose timer resolution wouldn't cause delays at
> that scale (at least delays of that magnitude - almost 1 sec). It
> almost seems like the Event version with timeout checked once a second
> whether the event had been set() during the past second.
> 


If this is on NT 4, I've done a fair amount of multithreaded com work
there.  On a heavily loaded system, NT seems to be very lousy at
waking up anywhere near the durations that you expect that it would.  I
have personally observed anyone from 10ms to 1500ms deltas from what I
requested and what they system delivered.  You probably should validate
this isn't a loaded NT problem first before you start trying to locate
the issue in python.

Greg



More information about the Python-list mailing list