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
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.
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