Bird
0
0

Given two tasks with equal priority and configUSE_TIME_SLICING set to 1, what will be the output if both tasks print their name in a loop with a delay?

medium📝 Predict Output Q4 of 15
FreeRTOS - Task Scheduling
Given two tasks with equal priority and configUSE_TIME_SLICING set to 1, what will be the output if both tasks print their name in a loop with a delay?
ABoth tasks print simultaneously without switching
BTask1 and Task2 print alternately in a time-sliced manner
COnly Task1 prints continuously, Task2 never runs
DTask2 prints first, then Task1 prints continuously
Step-by-Step Solution
Solution:
  1. Step 1: Understand time-slicing effect on equal priority tasks

    With time-slicing enabled, CPU switches between tasks regularly.
  2. Step 2: Predict output behavior

    Tasks will print alternately as CPU time is shared fairly.
  3. Final Answer:

    Task1 and Task2 print alternately in a time-sliced manner -> Option B
  4. Quick Check:

    Time-slicing output = C [OK]
Quick Trick: Equal priority tasks print alternately with time-slicing [OK]
Common Mistakes:
  • Assuming one task dominates CPU
  • Thinking tasks run simultaneously
  • Ignoring time-slicing config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes