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

Serge Orlov Serge.Orlov at gmail.com
Mon May 8 18:44:04 EDT 2006


Delaney, Timothy (Tim) wrote:
> OlafMeding at gmail.com wrote:
>
> > I am a bit surprised that nobody else has tried running the short
> > Python program above on a hyper-threading or dual core / dual
> > processor system.
>
> Does it happen every time? Have you tried it on multiple machines? Is it
> possible that that one machine is having problems? Does it take the same
> amount of time each run to replicate - and if so, how long is that (give
> or take a minute)?
>
> Until you can answer these questions with definite answers, people are
> not going to dedicate machines *that they use* for hours on end trying
> to replicate it. And from this thread, the time required appears to be
> "minutes to hours". That suggests you have a race condition which
> results in a deadlock - and of course, that is more likely to occur on a
> dual-core or dual-cpu machine, as you really have multiple threads
> executing at once.

The test program in question doesn't require a dedicated machine and it
doesn't consume a lot of CPU resources since it sleeps most of the
time.

> I'm surprised that so many people have been willing to dedicate as much
> time as they have, but then again considering the people involved it's
> not quite so surprising.

This "problem" doesn't require more time than any other in
comp.lang.python which I try to help to resolve. In fact, since OP is
not a newbie, it took less time than some newbie questions.




More information about the Python-list mailing list