2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

management/scheduler: improve periodic timing precision

This commit is contained in:
Sebastien Bourdeauducq 2014-12-11 15:57:41 +08:00
parent d315268ddb
commit 6ca39f7415

View File

@ -98,8 +98,8 @@ class Scheduler:
@asyncio.coroutine
def _schedule(self):
next_periodic = yield from self._run_periodic()
while True:
next_periodic = yield from self._run_periodic()
ev_queue = asyncio.Task(self.queue_count.acquire())
ev_periodic = asyncio.Task(self.periodic_modified.wait())
done, pend = yield from asyncio.wait(
@ -109,7 +109,7 @@ class Scheduler:
for t in pend:
t.cancel()
next_periodic = yield from self._run_periodic()
yield from self._run_periodic()
if ev_queue in done:
rid, run_params, timeout = self.queued.pop(0)
result = yield from self._run(rid, run_params, timeout)