Message302729
So here's the relevant piece of code:
end_time = self.time() + self._clock_resolution
while self._scheduled:
handle = self._scheduled[0]
if handle._when >= end_time:
break
handle = heapq.heappop(self._scheduled)
handle._scheduled = False
self._ready.append(handle)
As I see it, currently we peek into the future time. Why don't we do
end_time = self.time() - self._clock_resolution
to guarantee that timeouts will always be triggered *after* the requested time, not before? I don't see how the performance can become worse if we do this. |
|
Date |
User |
Action |
Args |
2017-09-21 21:41:54 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, pitrou, vstinner, r.david.murray, germn |
2017-09-21 21:41:54 | yselivanov | set | messageid: <1506030114.44.0.862085685567.issue31539@psf.upfronthosting.co.za> |
2017-09-21 21:41:54 | yselivanov | link | issue31539 messages |
2017-09-21 21:41:54 | yselivanov | create | |
|