Scheduling of Tasks
Let’s say you have created two tasks, Task 1 and Task 2 (Figure 1), both assigned equal priorities (Priority 4).
When you schedule the task, how will it be scheduled?
Since both the tasks have the same priorities, i.e., 4, these two tasks will be executed alternatively.
When you schedule these tasks, FreeRTOS will execute them alternately.
- Task 1 will run for some time slice, and then Task 2 will run for the next time slice.
- This alternation continues as long as both tasks remain eligible for execution.
- After the initial time slice, the scheduler will preempt the currently running task (Task 1) to allow the other task (Task 2) to run.
- This preemption ensures that both tasks get an equal opportunity to execute.
- The equal priority setting signifies that the scheduler gives equal importance to both tasks.
- It ensures fairness in task execution when multiple tasks with the same priority are competing for CPU time.
FastBit Embedded Brain Academy Courses
click here: https://fastbitlab.com/course1