Hi,
I'm searching informations about the multi-threading support in MicroPython.
I've seen this topic (one years old) viewtopic.php?f=2&t=1763&p=9956&hilit=m ... ding#p9956 about the uasyncio library.
But I've also seen this issue: https://github.com/micropython/micropython/issues/595 and 4 days ago someone says "Threading is now supported" without other information.
And Pycom is supporting the module _threading on their boards (https://docs.pycom.io/pycom_esp32/pycom ... ading.html).
Today, what the official way to support multi-threading on a pyboard ??
Thanks!
Thom
Multi-threading
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Multi-threading
For pre-emptive scheduling MicroPython supports the _thread module. Cooperative multi-tasking is supported via uasyncio, a subset of asyncio. There is an unofficial guide to the latter here https://github.com/peterhinch/micropython-async.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 15
- Joined: Thu Apr 27, 2017 6:40 pm
Re: Multi-threading
I have been using uasyncio in my projects on the esp3288 board from adafruit.
it based on the the info in peter's guide. it works for me as I do not need preemptive multitasking. his guide is easier to understand. but if your looking for another example of use you can look at https://github.com/thetreerat/WaterPump.
Hal
it based on the the info in peter's guide. it works for me as I do not need preemptive multitasking. his guide is easier to understand. but if your looking for another example of use you can look at https://github.com/thetreerat/WaterPump.
Hal