Bird
0
0

Given two tasks: Task1 with priority 4 and Task2 with priority 2, both ready to run, which task will FreeRTOS scheduler run first?

medium📝 Predict Output Q4 of 15
FreeRTOS - Task Priorities
Given two tasks: Task1 with priority 4 and Task2 with priority 2, both ready to run, which task will FreeRTOS scheduler run first?
ATask2 if it was created first
BTask2
CBoth run simultaneously
DTask1
Step-by-Step Solution
Solution:
  1. Step 1: Understand priority-based scheduling

    FreeRTOS always runs the highest priority task that is ready.
  2. Step 2: Compare priorities of Task1 and Task2

    Task1 has priority 4, which is higher than Task2's priority 2.
  3. Final Answer:

    Task1 -> Option D
  4. Quick Check:

    Higher priority task runs first = Task1 [OK]
Quick Trick: Higher priority tasks preempt lower ones [OK]
Common Mistakes:
  • Thinking creation order affects scheduling
  • Assuming tasks run simultaneously on single CPU
  • Believing lower priority tasks run first

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes