Bird
0
0

What is wrong with this task pool initialization code?

medium📝 Debug Q7 of 15
FreeRTOS - Design Patterns for RTOS
What is wrong with this task pool initialization code?
for(int i=0; i
AQueue is created after tasks start, tasks may access uninitialized queue
BStack size 500 is too small for workerTask
CTask priority 1 is invalid
DworkerHandles array is not declared
Step-by-Step Solution
Solution:
  1. Step 1: Check order of queue creation and task creation

    Queue must be created before tasks that use it start running.
  2. Step 2: Identify risk

    Tasks may try to access the queue before it exists, causing errors.
  3. Final Answer:

    Queue is created after tasks start, tasks may access uninitialized queue -> Option A
  4. Quick Check:

    Create queue before tasks that use it [OK]
Quick Trick: Always create queues before starting tasks that use them [OK]
Common Mistakes:
  • Ignoring creation order importance
  • Assuming stack size or priority is invalid
  • Overlooking workerHandles declaration

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes