Is "the Swiss guy" the linked video? I haven't watched it yet.bertel wrote: ↑Sun Feb 21, 2021 5:08 pmI don’t have any experience with threading in micropython, but according to the docs, _thread in micropython works just like in vanilla Python. There, threading uses the same core. To use multiple cores, we need to use multiPROCESSING. Most likely, the Swiss guy was tricked into believing threading uses multiple cores
But either way:
- On Pico we most definitely use both cores on the RP2040. The _thread module allows you to create at most one additional thread, and then you have the main thread on the first core, and the new thread on the second core. They run completely independently, and because they're 1:1 with cores, there's no scheduler or pre-emptive multitasking required. Additionally, as pythoncoder points out, there's no GIL on the Pico, so they really do run concurrently.
- On ESP32, all MicroPython threads (of which there can be as many as you like) are pinned to the same core, and we rely on FreeRTOS to pre-emptively schedule them. They run with the GIL.