FreeRTOS - Task SchedulingWhy does FreeRTOS preempt a running task immediately when a higher priority task becomes ready?ATo prevent lower priority tasks from running at allBTo allow tasks to run in the order they were createdCTo ensure the highest priority task gets CPU time as soon as possibleDTo reduce context switching overheadCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand preemption purposePreemption ensures that the highest priority task runs immediately to meet real-time requirements.Step 2: Evaluate other optionsLower priority tasks still run when higher priority tasks block; order of creation is not priority-based; preemption may increase context switches.Final Answer:To ensure the highest priority task gets CPU time as soon as possible -> Option CQuick Check:Preemption prioritizes highest priority task immediately [OK]Quick Trick: Preemption prioritizes highest priority task immediately [OK]Common Mistakes:Thinking preemption stops lower priority tasks foreverBelieving tasks run by creation orderAssuming preemption reduces context switches
Master "Task Scheduling" in FreeRTOS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More FreeRTOS Quizzes RTOS Fundamentals - Why RTOS over bare-metal - Quiz 14medium RTOS Fundamentals - Real-time vs general-purpose OS - Quiz 10hard RTOS Fundamentals - Tick timer and scheduler - Quiz 11easy Task Creation and Management - Why tasks are the building blocks - Quiz 14medium Task Creation and Management - Task priority assignment - Quiz 12easy Task Creation and Management - Task function signature - Quiz 4medium Task Scheduling - vTaskDelay() for periodic tasks - Quiz 9hard Task Scheduling - Why scheduling determines real-time behavior - Quiz 7medium Task Scheduling - vTaskDelayUntil() for precise timing - Quiz 3easy Task Scheduling - Time-slicing for equal priority tasks - Quiz 4medium