Bird
0
0

Given this FreeRTOS snippet, what is the error that prevents preemptive scheduling from working?

medium📝 Debug Q14 of 15
FreeRTOS - Task Scheduling
Given this FreeRTOS snippet, what is the error that prevents preemptive scheduling from working?
#define configUSE_PREEMPTION 0

void Task1(void *pvParameters) {
  while(1) {
    // Task code
  }
}

void Task2(void *pvParameters) {
  while(1) {
    // Task code
  }
}
AconfigUSE_PREEMPTION is set to 0, disabling preemption.
BTasks are missing priority assignments.
CTask functions must return int, not void.
DTasks need to call vTaskDelay to allow switching.
Step-by-Step Solution
Solution:
  1. Step 1: Check configUSE_PREEMPTION value

    The macro is set to 0, which disables preemptive scheduling.
  2. Step 2: Understand effect on scheduling

    With preemption disabled, tasks will not be interrupted automatically by higher priority tasks.
  3. Final Answer:

    configUSE_PREEMPTION is set to 0, disabling preemption. -> Option A
  4. Quick Check:

    configUSE_PREEMPTION = 0 disables preemption [OK]
Quick Trick: Preemption disabled if configUSE_PREEMPTION = 0 [OK]
Common Mistakes:
  • Thinking tasks must return int
  • Assuming missing priorities cause preemption failure
  • Believing vTaskDelay is required for preemption

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes