Bird
0
0

Why is vTaskDelayUntil() preferred over vTaskDelay() for implementing periodic tasks in FreeRTOS?

hard📝 Conceptual Q10 of 15
FreeRTOS - Task Scheduling
Why is vTaskDelayUntil() preferred over vTaskDelay() for implementing periodic tasks in FreeRTOS?
ABecause it maintains a fixed execution period preventing cumulative timing drift
BBecause it allows tasks to run immediately without any delay
CBecause it automatically adjusts task priority based on execution time
DBecause it uses less CPU time than vTaskDelay()
Step-by-Step Solution
Solution:
  1. Step 1: Understand vTaskDelay()

    vTaskDelay delays a task for a fixed time from the call moment, causing drift if task execution varies.
  2. Step 2: Understand vTaskDelayUntil()

    vTaskDelayUntil delays a task until a fixed point in time relative to last wake time, maintaining consistent periodicity.
  3. Step 3: Conclusion

    vTaskDelayUntil prevents cumulative drift by referencing absolute time, making it ideal for periodic tasks.
  4. Final Answer:

    Because it maintains a fixed execution period preventing cumulative timing drift -> Option A
  5. Quick Check:

    Check drift prevention mechanism [OK]
Quick Trick: vTaskDelayUntil prevents drift by using absolute wake times [OK]
Common Mistakes:
  • Assuming vTaskDelayUntil runs tasks immediately
  • Confusing delay duration with priority changes
  • Believing vTaskDelay uses less CPU time

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes