Bird
0
0

You need to create multiple FreeRTOS tasks with different stack sizes based on their workload. Which approach is best to allocate stack sizes efficiently?

hard📝 Application Q8 of 15
FreeRTOS - Task Creation and Management
You need to create multiple FreeRTOS tasks with different stack sizes based on their workload. Which approach is best to allocate stack sizes efficiently?
AEstimate each task's maximum stack usage and allocate accordingly
BAssign the same large stack size to all tasks to avoid overflow
CUse the smallest stack size for all tasks to save memory
DAllocate stack size randomly and monitor task behavior
Step-by-Step Solution
Solution:
  1. Step 1: Understand stack size allocation strategy

    Allocating stack based on estimated maximum usage avoids waste and overflow.
  2. Step 2: Evaluate other options

    Same large size wastes memory, smallest size risks overflow, random allocation is unsafe.
  3. Final Answer:

    Estimate each task's maximum stack usage and allocate accordingly -> Option A
  4. Quick Check:

    Allocate stack based on task needs for efficiency [OK]
Quick Trick: Estimate max usage per task for stack allocation [OK]
Common Mistakes:
  • Using same large stack wastes memory
  • Using smallest stack causes crashes
  • Random allocation causes instability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes