Multiprocess/task concurrency scheduling question
Multiprocess/task concurrency scheduling question
Wanted to clarify a question I had. ESP-IDF runs on top of FreeRTOS. From my understanding FreeRTOS is not capable of true parallel processing of running scheduled tasks concurrently. My question is does that mean ESP-IDF is also incapable of utilizing it's two cores for one app for concurrent multitasking? Does it bypass this by running two instances of FreeRTOS/apps on each core and having them communicate with each other manually?
Re: Multiprocess/task concurrency scheduling question
Hi aaronhshi,
FreeRTOS version included in ESP-IDF has been modified to allow tasks on two CPUs to run concurrently. This was done by extending internal data structures to account for the 2nd CPU, modifying the scheduling algorithm, and adding extra critical sections to FreeRTOS source code. From user perspective, tasks running on two CPUs share the same memory and can use FreeRTOS primitives (queues, etc.) to communicate with each other pretty much like they are used in a single core scenario. The few things that are different from single core FreeRTOS are listed here: https://docs.espressif.com/projects/esp ... s-smp.html.
FreeRTOS version included in ESP-IDF has been modified to allow tasks on two CPUs to run concurrently. This was done by extending internal data structures to account for the 2nd CPU, modifying the scheduling algorithm, and adding extra critical sections to FreeRTOS source code. From user perspective, tasks running on two CPUs share the same memory and can use FreeRTOS primitives (queues, etc.) to communicate with each other pretty much like they are used in a single core scenario. The few things that are different from single core FreeRTOS are listed here: https://docs.espressif.com/projects/esp ... s-smp.html.
Re: Multiprocess/task concurrency scheduling question
Question - how does the cpu scaling or esp32 scaling look like?
I read some documents it is possible to connect two esp32 chips physically on one board and use them as one 4-core from app perspective
I read some documents it is possible to connect two esp32 chips physically on one board and use them as one 4-core from app perspective
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Multiprocess/task concurrency scheduling question
That would be very hard, as there's no way to access internal memory directly from outside the ESP32; multi-core in a multi-threading environment kind-of implies that all memory is shared. I'm not sure what that paper was talking about, but the multi-threading solution as we have in esp-idf does not transparently scales between CPUs. You can still use the CPU power of multiple ESPs, but you'll have to write an application for each individual one and handle communication on that level.
Who is online
Users browsing this forum: No registered users and 137 guests