Bird
0
0

You want to implement a task pool in FreeRTOS that scales the number of active worker tasks based on workload demand. Which design approach is most appropriate?

hard📝 Application Q8 of 15
FreeRTOS - Design Patterns for RTOS
You want to implement a task pool in FreeRTOS that scales the number of active worker tasks based on workload demand. Which design approach is most appropriate?
ACreate a fixed number of worker tasks and use a queue to buffer work items, adjusting task priorities dynamically
BDynamically create and delete worker tasks as workload changes, ensuring proper synchronization and resource cleanup
CUse a single high-priority task to process all work items sequentially to avoid complexity
DAssign each incoming work item to a new task without pooling to maximize parallelism
Step-by-Step Solution
Solution:
  1. Step 1: Understand dynamic scaling needs

    The number of active workers should increase or decrease based on workload.
  2. Step 2: Evaluate options

    Creating and deleting tasks dynamically allows adapting to workload but requires careful synchronization.
  3. Step 3: Why other options are less suitable

    Fixed tasks with priority changes don't scale number of tasks; single task limits concurrency; no pooling wastes resources.
  4. Final Answer:

    Dynamically create and delete worker tasks as workload changes, ensuring proper synchronization and resource cleanup -> Option B
  5. Quick Check:

    Dynamic task management fits variable workloads [OK]
Quick Trick: Create/delete tasks dynamically for scaling [OK]
Common Mistakes:
  • Relying only on priority changes to scale
  • Using a single task for all work
  • Creating a new task per item without pooling

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes