Using time.sleep() in 2 threads causes lockup when hyper-threading is enabled

Grant Edwards grante at visi.com
Fri May 5 17:46:05 EDT 2006


On 2006-05-05, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> In <1146798159.209695.4190 at j33g2000cwa.googlegroups.com>, OlafMeding
> wrote:
>
>>> IIRC it was something like an NTP daemon that caused the clock
>>> to "jump" a little and (Window's) sleep was confused.
>> 
>> The problem is not a "jump" but a permanet lockup of the sleep
>> statement.
>
> The "jump" of the system clock might confuse the systems
> `sleep` implementation.

I wouldn't be a bit surprised if MS write code to wake up a
task when the currentTime == task.wakeupTime instead of when 
currentTime >= task.wakeupTime.  If the system time jumps past
the "wakeup" point without ever passing through it, the task
sleeps forever. 

Microsoft's bungling of simple things like timer ticks is
legend in some circles:

  http://www.embedded.com/showArticle.jhtml?articleID=57703680
  http://www.embedded.com/showArticle.jhtml?articleID=159902113
  
-- 
Grant Edwards                   grante             Yow!  I'm young... I'm
                                  at               HEALTHY... I can HIKE
                               visi.com            THRU CAPT GROGAN'S LUMBAR
                                                   REGIONS!



More information about the Python-list mailing list