Bird
0
0

Examine this FreeRTOS code snippet:

medium📝 Debug Q6 of 15
FreeRTOS - Interrupt Management
Examine this FreeRTOS code snippet:
taskENTER_CRITICAL();
sharedCount++;
// No taskEXIT_CRITICAL() called
What issue does this cause?
ATask scheduler is suspended indefinitely
BsharedCount is not incremented correctly
CInterrupts remain disabled, causing system unresponsiveness
DNo issue; code is safe
Step-by-Step Solution
Solution:
  1. Step 1: Understand taskENTER_CRITICAL()

    This function disables interrupts to protect critical sections.
  2. Step 2: Missing taskEXIT_CRITICAL()

    Without taskEXIT_CRITICAL(), interrupts remain disabled indefinitely.
  3. Step 3: Consequences

    System becomes unresponsive as interrupts are blocked, affecting real-time behavior.
  4. Final Answer:

    Interrupts remain disabled, causing system unresponsiveness -> Option C
  5. Quick Check:

    Always pair taskENTER_CRITICAL() with taskEXIT_CRITICAL() [OK]
Quick Trick: Always match taskENTER_CRITICAL() with taskEXIT_CRITICAL() [OK]
Common Mistakes:
  • Assuming sharedCount increment fails
  • Confusing interrupt disabling with task suspension
  • Believing no issue occurs without exit call

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes