What happens if two FreeRTOS tasks have the same priority and are both ready to run?
medium📝 Conceptual Q5 of 15
FreeRTOS - Task Creation and Management
What happens if two FreeRTOS tasks have the same priority and are both ready to run?
AThe system crashes due to priority conflict
BOnly the first created task runs forever
CThe scheduler time-slices between the tasks, switching regularly
DBoth tasks run simultaneously on a single core
Step-by-Step Solution
Solution:
Step 1: Understand FreeRTOS scheduling for equal priority tasks
FreeRTOS uses time slicing to share CPU time fairly among tasks of equal priority.
Step 2: Evaluate other options
Only 'The scheduler time-slices between the tasks, switching regularly' is correct; options suggesting crash, one task running forever, or simultaneous execution misrepresent scheduling.
Final Answer:
The scheduler time-slices between the tasks, switching regularly -> Option C
Quick Check:
Equal priority tasks share CPU time [OK]
Quick Trick:Equal priority tasks share CPU by time slicing [OK]
Common Mistakes:
Thinking one task runs forever
Assuming simultaneous execution on single core
Believing system crashes on priority tie
Master "Task Creation and Management" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently