Categories of Task Scheduling Algorithms
Several task-scheduling techniques available in a Real-Time Operating System (RTOS) have both benefits and drawbacks depending on the the needs of the system and the nature of the tasks under execution. Among the most often used algorithms are:
1. Run for Completion (RTC)
The simplest approach is the Run to Completion algorithm. Every job runs till finished before moving onto the next one. Once all activities are finished, the sequence repeats itself from the start.
Advantages |
|
Disadvantages |
|
2. Round Robin (RR)
Round Robin is similar to RTC, but a task does not have to complete all its work before releasing the CPU. When it is scheduled again, the task resumes from where it left off.
Advantages:
Advantages |
|
Disadvantages |
|
3. Time Slice (TS)
A pre-emptive scheduling algorithm in which execution time is broken into minute pieces known as time slices or ticks (e.g., 1 ms). The scheduler picks one task from the whole task list to run every time an interrupt happens.
Advantages |
|
Disadvantages |
|
4. Fixed Priority (FP)
Fixed Priority assigns a static priority based on urgency to every job. The scheduler always chooses the task with the highest priority to run first.
If:
- Many activities share the same priority; they are done in round robin.
- While another task is running, a higher-priority task emerges and instantly interrupts the current operation.
Advantages |
|
Disadvantages |
|
5. Earliest Deadline First (EDF)
Dynamic priority according to the deadline of each assignment is provided by the Earliest Deadline First method. The one with the shortest deadline is always done first.
- Two jobs with the same deadline are done in round robin.
Theoretically, EDF is ideal since it can plan any possible collection of jobs.
Advantages |
|
Disadvantages |
|