forked from FreeRTOS/FreeRTOS-SMP-Demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gaurav Aggarwal <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
The FreeRTOS API remains mostly same between single core and SMP version except | ||
[these additions](SMP.md). Therefore, an application written for FreeRTOS single | ||
core version should compile with SMP version with minimal to no effort. However, | ||
there may be some functional issues as some assumptions which used to be true | ||
for single core may no longer be true for multi-cores. | ||
The FreeRTOS API remains substantially the same between single core and SMP | ||
versions except for [these additions](SMP.md). Therefore, an application written | ||
for the FreeRTOS single core version should compile with the SMP version with | ||
minimal to no effort. However, there may be some functional issues, as some | ||
assumptions which were true for single core applications may no longer be true | ||
for those on multi-cores. | ||
|
||
One such common assumption is that a lower priority task cannot be running while | ||
a higher priority task is running. While this used to be true for single core, | ||
it is no longer true for multi-cores as multiple tasks can be running | ||
simultaneously. If the application relies on relative task priorities to provide | ||
mutual exclusion, it may observe unexpected results in multi-core environment. | ||
The application writer has couple of options to address it: | ||
One such common assumption is that a lower priority task cannot run while a | ||
higher priority task is running. While this was true on a single core, it is no | ||
longer true for multi-cores, as multiple tasks can be running simultaneously. If | ||
the application relies on relative task priorities to provide mutual exclusion, | ||
it may observe unexpected results in a multi-core environment. The application | ||
writer has couple of options to address this: | ||
|
||
1. The best option is to update the application to not rely on task priorities | ||
and use synchronization primitives instead. | ||
1. The best option is to update the application so that it does not rely on task | ||
priorities and uses synchronization primitives instead. | ||
2. Another option is to pin all the tasks which must not be running | ||
simultaneously to one core using `vTaskCoreAffinitySet` API. | ||
simultaneously to one core using the `vTaskCoreAffinitySet` API. | ||
3. Another option is to define `configRUN_MULTIPLE_PRIORITIES` to `0` which | ||
ensures that multiple tasks will run simultaneously only if they have same | ||
priority. Note that it may result in under utilization and put some cores to | ||
idle while they could be used to run other low priority tasks. | ||
ensures that multiple tasks will run simultaneously only if they have the | ||
same priority. Note that this may result in under utilization and put some | ||
cores to idle when they could be used to run other low priority tasks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters