Bill Sobel added the comment:
I'd like to suggest a easy fix here (I saw this was closed, but the posters
were asking for a behavior change). With this fix there is no behavior change
to callers or new parameters to the API.
if remaining >= 4.0:
maxDelay = 1
else:
maxDelay = .05
dela
Antoine Pitrou added the comment:
Locks in 2.7 don't support a timeout, which is why Condition.wait has a polling
loop. The comment explains it all:
# Balancing act: We can't afford a pure busy loop, so we
# have to sleep; but if we sleep the whole timeout time,
# we'll be unresponsive.
L
Jaroslav Škarvada added the comment:
The current behaviour is not good for power consumption especially with the
current tickless kernels - the python processes using "threading" shows in the
top of the "powertop" list (on machine tuned for low power consumption) causing
20 wakeups per second.
New submission from Bohuslav "Slavek" Kabrda:
On Python 2, Condition.wait timeout is always taken as
min(delay * 2, remaining, .05)
which means it cannot be longer than 50 ms. I don't see a reason for this and
AFAIK this is no longer true for Python 3, where timeout can be arbitrarily
long. W