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

OlafMeding at gmail.com OlafMeding at gmail.com
Wed May 3 22:58:50 CEST 2006


> What do you mean "stop responding"?

Both threads print their thread numbers (either 1 or 2) approximately
every 10 seconds.  However, after a while (minutes to hours) both
programs (see above) hang!

Pressing ctrl-c (after the printing stops) causes the threads to "wake
up" from their sleep statement.  And since the sleep took more than 1
seconds the thread number and the duration of the sleep is printed to
the screen.

Do you have a hyper-threading/dual/multi core CPU?  Did you try this?

Olaf




More information about the Python-list mailing list