Along the lines of https://community.hiveeyes.org/t/micropython-quo-vadis/2357 . Paul Sokolovsky is conceiving the fine uasyncio
library and recently forked Vanilla MicroPython into Pycopy MicroPython.
Overview
Early days of MPY uasyncio
Paul Sokolovsky on May 1; 2017:
pfalcon commented on May 1, 2017
Ok, the current outcome of optimizing uasyncio during last half-year:
With picoweb built as frozen bytecode, while the picoweb reference application, https://github.com/pfalcon/notes-pico , run as non-frozen bytecode (it can’t be frozen, because we don’t support accessing resources in frozen modules, #1346 ), all of that on 32-bit unix, is able to run within 30KB of heap, with notes-pico code taking 7KB of it. This shows that the technology should be viable for platforms like esp8266, at least for simple apps, but requires further optimization and implementation of missing features (assuming the ultimate target is indeed writing webapps).
– https://github.com/micropython/micropython/issues/2622#issuecomment-298263043
MPY uasyncio
Until June 2019.
Pycopy uasyncio
Beginning July 2019.
micropython-async
module
By Peter Hinch.
Favorite candidates
https://pypi.org/project/pycopy-uasyncio
Using uasyncio
on the ESP8266
How to install micropython-uasyncio
on PyCom hardware
Lightweight threading
Weitere Möglichkeiten zur Abarbeitung quasi-nebenläufiger Ausführungsfäden bieten leichtgewichtige Microthreads.
Ein frühes Ding in diesem Bereich ist der
https://github.com/peterhinch/Micropython-scheduler
Diese Reise geht in die Richtung, wie man “asynchronous programming” auf der Basis von kooperativem Multitasking oftmals realisiert.
Hintergrundinformationen
If a coroutine/thread yields a jump target, the scheduler can jump where requested (unless overridden by thread priorities, perhaps). However, if a coroutine/thread merely yields None
, the scheduler could make its own decision about the appropriate thread for the next attention. There would be a bit of work involved in deciding (and programming) exactly how an arbitrary jump would interact with a linear thread queue, but nothing particularly mysterious about the work.
Ein Scheduler, der ein solches Pseudomultitasking-Konzept auf Basis von Koroutinen realisiert, nennt sich häufig auch Trampoline Scheduler .
If you are interested in more details about these asynchronous techniques, how they might be implemented on the system level and how all of this eventually relates to addressing http://www.kegel.com/c10k.html , you might enjoy reading https://netfrag.org/~amo/documents/tech/lightweight-scaling.html .
Im MicroPython-Land ist die Reisegruppe gerade hier angekommen.
Andreas
December 1, 2019, 10:20pm
5
New uasyncio
version
While the original uasyncio
implementation for MicroPython has been contributed by Paul Sokolovsky , Damien George now has a complete rewrite in the pipeline, see