← index #5857PR #164
Related · medium · value 0.564
QUERY · ISSUE

extmod/uasyncio Provide means of scheduling I/O with high priority

openby peterhinchopened 2020-04-02updated 2020-05-04

This was discussed at length in the past, and prototyped with early code of this uasyncio. There is known demand for it in high speed UART applications and audio processing. Salient points:

  • Enable I/O readiness to be tested on every pass of the scheduler.
  • The facility to be available on a per-interface basis. A subset of active interfaces can be selected to run at high priority.

This would improve real time throughput and reduce buffering requirements

CANDIDATE · PULL REQUEST

uasyncio.core: Fix scheduling in the presense of I/O completion callbacks.

closedby pfalconopened 2017-04-06updated 2020-07-18

wait() may finish prematurely due to I/O completion, and schedule new,
earlier than before tasks to run. So, after call to wait(), we need to
check current time and time of head task, and continue to wait if needed.
Recently introduced provisional utimeq.peektime() is used to optimize
querying time of a head task.

5 comments
pfalcon · 2017-04-06

For review to: @dpgeorge , @peterhinch, @prusnak, @jpochyla.

Note that there's a testcase which now passes: https://github.com/micropython/micropython-lib/commit/aa9bbe839eac5bce0a0e5169f63730b13a638b64 . Full uasyncio integration tests weren't yet run though.

dpgeorge · 2017-04-07

It looks ok to me.

peterhinch · 2017-04-07

It fixes https://github.com/micropython/micropython/issues/3005.

pfalcon · 2017-04-07

Ok, thanks for testing! I also ran standard uasyncio integration tests, all's ok, so I'm merging this to master. But not tagging a new release yet, so there's still time to catch last-minute regressions ;-).

pfalcon · 2017-04-20

Finally pushed to PyPI.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied