Bird
0
0

You want to implement a task pool with 3 worker tasks to handle variable workloads efficiently. Which approach is best?

hard📝 Application Q15 of 15
FreeRTOS - Design Patterns for RTOS
You want to implement a task pool with 3 worker tasks to handle variable workloads efficiently. Which approach is best?
AUse a single task with vTaskDelay to process all work items sequentially.
BCreate 3 tasks that poll the queue with zero timeout in a tight loop.
CCreate 3 tasks that block on xQueueReceive with portMAX_DELAY and send work via a queue.
DCreate a new task for each work item dynamically and delete it after processing.
Step-by-Step Solution
Solution:
  1. Step 1: Understand efficient task pooling

    Efficient pooling uses fixed tasks that wait (block) for work to avoid wasting CPU.
  2. Step 2: Evaluate options for workload handling

    Blocking on xQueueReceive with portMAX_DELAY lets tasks sleep until work arrives, saving CPU and memory.
  3. Final Answer:

    Create 3 tasks that block on xQueueReceive with portMAX_DELAY and send work via a queue. -> Option C
  4. Quick Check:

    Block on queue = efficient task pool [OK]
Quick Trick: Block tasks on queue to save CPU and handle dynamic work [OK]
Common Mistakes:
  • Polling queue wastes CPU
  • Creating tasks dynamically wastes memory
  • Using single task delays reduces responsiveness

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes