Using RTOS tasks with or without cpu core affinity
Posted: Fri Dec 15, 2017 11:43 pm
I am quite new to ESP32, coming from PIC32 MCUs which are all single core. So I would like to check if I'm right when it comes to running FreeRTOS scheduler on two cores. It seems to me that if a task is pinned to one core, than this task could be skipped by scheduler in round robin scheme (same priority tasks run in turn triggered by ticks) since both cores are using the same pointer to a task list of that specific priority, but looking only for tasks with no affinity or pinned to that specific core. So when one core skips the task pinned to the other core, it moves the pointer forward and the other core will continue traversing the task list from that point on, which means the skipped task won't be run.
If I'm right, then it seems a better strategy would be to create all application tasks with no cpu affinity. By doing that, all tasks can be run by both cores which guarantees no task would be ever skipped like in the above scenario.
I would appreciate a comment from someone with more experience in this matter.
If I'm right, then it seems a better strategy would be to create all application tasks with no cpu affinity. By doing that, all tasks can be run by both cores which guarantees no task would be ever skipped like in the above scenario.
I would appreciate a comment from someone with more experience in this matter.