Bird
0
0

What is wrong with this FreeRTOS idle hook implementation?

medium📝 Debug Q6 of 15
FreeRTOS - Task Scheduling

What is wrong with this FreeRTOS idle hook implementation?

void vApplicationIdleHook(void) {
for(;;) {
// background processing
}
}

AIt will cause a stack overflow immediately.
BIt correctly performs background work without issues.
CIt causes the idle task to never yield, blocking other tasks.
DIt disables the scheduler unintentionally.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the infinite loop

    The idle hook runs inside the idle task; an infinite loop here prevents the idle task from yielding.
  2. Step 2: Consequence

    This blocks other tasks from running, causing system issues.
  3. Final Answer:

    It causes the idle task to never yield, blocking other tasks. -> Option C
  4. Quick Check:

    Idle hook must not block or loop infinitely [OK]
Quick Trick: Idle hook must not block or loop infinitely [OK]
Common Mistakes:
  • Using infinite loops inside idle hook
  • Assuming idle hook runs in separate thread
  • Ignoring scheduler behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes