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

OlafMeding at gmail.com OlafMeding at gmail.com
Wed May 3 17:05:43 EDT 2006


Time

>>>
1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1
2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2
1 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1
>>>

This is exactly what you should see.  The problem I see is that after a
while (minutes to hours) the printing of 1s and 2s stops!  If you press
ctrl-c at that point the threads will print how many seconds they were
stuck in the sleep statements (proving that the threads were stuck in
the sleep statement until you pressed ctrl-c).

Could you please try again (perhaps let it run overnight)?   Many, many
thanks.

Olaf




More information about the Python-list mailing list