multi-threading question

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
a-ha
Posts: 21
Joined: Sat Jun 27, 2020 10:42 pm

multi-threading question

Post by a-ha » Mon Jun 29, 2020 4:54 am

Does the _thread module take advantage of the dual cores of esp32?
If I create 2 threads, will they be scheduled to be running on separate core?

thanks
a-ha

Online
User avatar
pythoncoder
Posts: 4268
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: multi-threading question

Post by pythoncoder » Mon Jun 29, 2020 5:48 am

I'm pretty sure the answer is no: MicroPython runs on one core and FreeRTOS on the other.
Peter Hinch

User avatar
jimmo
Posts: 1710
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: multi-threading question

Post by jimmo » Mon Jun 29, 2020 6:02 am

That's right. At startup a FreeRTOS task is created for MicroPython, pinned to core 1, and all threads are also pinned to this core.

From memory the most recent discussion of this topic was here -- https://github.com/micropython/micropython/issues/4895

a-ha
Posts: 21
Joined: Sat Jun 27, 2020 10:42 pm

Re: multi-threading question

Post by a-ha » Mon Jun 29, 2020 7:30 am

Ok I see. FreeRTOS is used by micropython? Nice. Is this only for the esp32 board ? or for all cpu's?

User avatar
jimmo
Posts: 1710
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: multi-threading question

Post by jimmo » Mon Jun 29, 2020 12:42 pm

Just ESP32.

Post Reply