Bird
0
0

What happens if two FreeRTOS tasks have the same priority and are both ready to run?

medium📝 Predict Output 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 scheduler picks one randomly and runs it forever
BThe scheduler runs them in a round-robin fashion
CThe task created first always runs first
DBoth tasks run simultaneously on separate cores
Step-by-Step Solution
Solution:
  1. Step 1: Recall FreeRTOS scheduling for equal priority tasks

    FreeRTOS uses time slicing (round-robin) to share CPU between equal priority tasks.
  2. Step 2: Understand round-robin behavior

    Each task runs for a time slice, then the scheduler switches to the next task of same priority.
  3. Final Answer:

    The scheduler runs them in a round-robin fashion -> Option B
  4. Quick Check:

    Equal priority tasks = round-robin scheduling [OK]
Quick Trick: Equal priority tasks share CPU time round-robin [OK]
Common Mistakes:
  • Assuming one task runs forever
  • Thinking creation order matters
  • Believing tasks run simultaneously on single core

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes