Bird
0
0

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

easy📝 Conceptual Q1 of 15
FreeRTOS - Task Scheduling

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

AThe scheduler runs the task that was ready first until it blocks or yields.
BThe scheduler runs both tasks simultaneously on different cores.
CThe scheduler randomly picks one task to run each time.
DThe scheduler ignores one task and runs only the other.
Step-by-Step Solution
Solution:
  1. Step 1: Understand FreeRTOS scheduling for equal priority tasks

    FreeRTOS uses time slicing for tasks with the same priority, switching between them in a round-robin fashion when tasks yield or block.
  2. Step 2: Analyze scheduler behavior for same priority tasks

    The scheduler switches between tasks of equal priority in a round-robin manner, not running one task exclusively until it blocks.
  3. Final Answer:

    The scheduler switches between tasks of equal priority in a round-robin fashion when they are both ready. -> Option C
  4. Quick Check:

    Equal priority tasks share CPU time via round-robin = D [OK]
Quick Trick: Same priority tasks share CPU time via round-robin [OK]
Common Mistakes:
  • Assuming tasks run simultaneously on single-core
  • Thinking scheduler picks randomly
  • Believing one task is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes