Time-slicing is a method where tasks of equal priority share CPU time by switching between them at regular intervals, ensuring each gets a fair chance to run.
Click to reveal answer
beginner
How does FreeRTOS decide which equal priority task to run during time-slicing?
FreeRTOS uses a round-robin approach, switching between tasks of the same priority every tick interrupt to give each task CPU time.
Click to reveal answer
intermediate
Which FreeRTOS configuration setting enables time-slicing for equal priority tasks?
The configuration setting `configUSE_TIME_SLICING` must be set to 1 to enable time-slicing in FreeRTOS.
Click to reveal answer
intermediate
What happens if time-slicing is disabled in FreeRTOS for equal priority tasks?
If time-slicing is disabled, the first ready task of equal priority runs until it blocks or yields, potentially starving other tasks of the same priority.
Click to reveal answer
beginner
Explain why time-slicing is important for tasks with equal priority in FreeRTOS.
Time-slicing ensures fairness by allowing all equal priority tasks to run in turn, preventing any single task from monopolizing the CPU.
Click to reveal answer
What scheduling method does FreeRTOS use for tasks with equal priority when time-slicing is enabled?
ARound-robin
BFirst come, first served
CPriority inversion
DRandom selection
✗ Incorrect
FreeRTOS uses round-robin scheduling to switch between equal priority tasks during time-slicing.
Which configuration option must be enabled to allow time-slicing in FreeRTOS?
AconfigMAX_PRIORITIES
BconfigUSE_PREEMPTION
CconfigUSE_TIME_SLICING
DconfigUSE_IDLE_HOOK
✗ Incorrect
The configUSE_TIME_SLICING option enables time-slicing for equal priority tasks.
If time-slicing is disabled, what happens to equal priority tasks in FreeRTOS?
AAll tasks run simultaneously
BTasks run in parallel
CTasks are scheduled randomly
DOnly the first ready task runs until it blocks or yields
✗ Incorrect
Without time-slicing, the first ready task runs until it blocks or yields, which can cause other equal priority tasks to wait.
How often does FreeRTOS switch between equal priority tasks during time-slicing?
AOnly when a task blocks
BAt every tick interrupt
CEvery second
DWhen manually triggered
✗ Incorrect
FreeRTOS switches tasks at every tick interrupt to share CPU time fairly among equal priority tasks.
Why is time-slicing important in a real-time operating system like FreeRTOS?
ATo ensure fairness among equal priority tasks
BTo increase CPU speed
CTo reduce memory usage
DTo disable interrupts
✗ Incorrect
Time-slicing ensures that all tasks with the same priority get CPU time fairly, preventing any single task from dominating.
Describe how FreeRTOS manages CPU time among tasks with equal priority when time-slicing is enabled.
Think about how the system switches tasks regularly to be fair.
You got /4 concepts.
Explain the consequences of disabling time-slicing for equal priority tasks in FreeRTOS.
Consider what happens if one task never stops running.
You got /4 concepts.
Practice
(1/5)
1. What does time-slicing mean in FreeRTOS when tasks have equal priority?
easy
A. Higher priority tasks are paused to let lower priority tasks run.
B. The CPU time is shared fairly among tasks with the same priority.
C. Tasks with equal priority run one after another without switching.
D. Only the first created task runs until it finishes.
Solution
Step 1: Understand time-slicing concept
Time-slicing means the CPU divides its time between tasks that have the same priority.
Step 2: Apply to FreeRTOS behavior
FreeRTOS automatically switches between equal priority tasks to share CPU time fairly.
Final Answer:
The CPU time is shared fairly among tasks with the same priority. -> Option B
Quick Check:
Time-slicing = fair CPU sharing [OK]
Hint: Equal priority means tasks share CPU time fairly [OK]
Common Mistakes:
Thinking only one task runs until it finishes
Believing tasks run sequentially without switching
In FreeRTOS, the fifth parameter in xTaskCreate is the task priority.
Step 2: Identify equal priorities
Both tasks have priority 2 in xTaskCreate(task1, "Task1", 1000, NULL, 2, NULL); xTaskCreate(task2, "Task2", 1000, NULL, 2, NULL);, making them equal priority tasks.
Final Answer:
Both tasks have priority 2, so they have equal priority. -> Option A
Quick Check:
Same priority number = equal priority [OK]
Hint: Same priority number means equal priority [OK]
Common Mistakes:
Assigning different priority numbers to tasks
Confusing task stack size with priority
Using priority 0 and 1 as equal
3. Given two tasks with equal priority in FreeRTOS, what is the expected behavior when both are ready to run?
medium
A. Both tasks run simultaneously on the same CPU core.
B. One task runs to completion before the other starts.
C. The second task never runs because the first task blocks it.
D. The scheduler switches between tasks periodically to share CPU time.
Solution
Step 1: Understand FreeRTOS scheduling for equal priority tasks
FreeRTOS uses time-slicing to switch between tasks of equal priority.
Step 2: Predict scheduler behavior
The scheduler switches tasks periodically, giving each task CPU time in turn.
Final Answer:
The scheduler switches between tasks periodically to share CPU time. -> Option D
Quick Check:
Equal priority tasks share CPU via switching [OK]
Hint: Equal priority tasks get CPU time by switching [OK]
Common Mistakes:
Thinking tasks run one after another without switching
Assuming tasks run simultaneously on one core
Believing one task blocks the other forever
4. You have two tasks with equal priority, but one task never seems to run. What is the most likely cause?
medium
A. The task that never runs has a higher priority number.
B. FreeRTOS does not support time-slicing for equal priority tasks.
C. The task that never runs is blocked or waiting indefinitely.
D. The scheduler is disabled, so no task switching occurs.
Solution
Step 1: Check task states in FreeRTOS
Even with equal priority, a task that is blocked or waiting will not run.
Step 2: Identify why a task never runs
If a task never runs, it is likely blocked or waiting indefinitely, not ready to run.
Final Answer:
The task that never runs is blocked or waiting indefinitely. -> Option C
Quick Check:
Blocked task = no CPU time [OK]
Hint: Blocked tasks don't get CPU time even if priority is equal [OK]
5. You have three tasks with equal priority in FreeRTOS. Task A runs for 10ms, Task B for 20ms, and Task C for 30ms before yielding. How does time-slicing affect their CPU time distribution?
hard
A. Each task gets equal CPU time slices regardless of run duration before yielding.
B. Tasks that run longer before yielding get more CPU time overall.
C. Task C will starve Tasks A and B because it runs longest.
D. FreeRTOS runs tasks in creation order ignoring time-slicing.
Solution
Step 1: Understand time-slicing with equal priority tasks
FreeRTOS scheduler switches tasks periodically to share CPU time fairly among equal priority tasks.
Step 2: Analyze effect of different run durations before yielding
Even if tasks run different times before yielding, the scheduler enforces time slices to balance CPU time.
Final Answer:
Each task gets equal CPU time slices regardless of run duration before yielding. -> Option A
Quick Check:
Time-slicing ensures fair CPU time despite run length [OK]
Hint: Time-slicing balances CPU time regardless of task run length [OK]
Common Mistakes:
Assuming longer running tasks get more CPU time
Thinking tasks can starve others with longer runs
Believing task creation order controls CPU time
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.