Bird
0
0

You have a shared resource accessed by multiple tasks and interrupts. Which approach best protects the resource while keeping system responsiveness high?

hard📝 Application Q15 of 15
FreeRTOS - Interrupt Management
You have a shared resource accessed by multiple tasks and interrupts. Which approach best protects the resource while keeping system responsiveness high?
AUse long critical sections with taskENTER_CRITICAL() and taskEXIT_CRITICAL() around all resource access
BUse short critical sections only around the minimal code that accesses the resource
CDisable all interrupts globally for the entire program runtime
DAvoid using critical sections and rely on task delays
Step-by-Step Solution
Solution:
  1. Step 1: Understand impact of critical section length

    Long critical sections block interrupts for too long, reducing system responsiveness.
  2. Step 2: Best practice for protecting shared resources

    Short critical sections minimize interrupt blocking while protecting shared data safely.
  3. Final Answer:

    Use short critical sections only around the minimal code that accesses the resource -> Option B
  4. Quick Check:

    Short critical sections = better responsiveness [OK]
Quick Trick: Keep critical sections short for best performance [OK]
Common Mistakes:
  • Using long critical sections unnecessarily
  • Disabling interrupts globally
  • Ignoring synchronization needs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes