Skip to main content

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:

  • Simple and quick to put into practice.

Disadvantages:

  • Other tasks influence the completion time of a job, therefore reducing the determinacy of the system.

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:

  • Provides a fairer time allocation to each task.
  • More adaptable than RTC.

Disadvantages:

  • Still relies on how each job behaves and is unable to stop one from taking over the processor for too long.

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:

  • Stops starvation (a job kept too long).

Disadvantages:

  • Can lead to repeated context switching, hence raising system overhead.

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:

  • Uncomplicated and efficient; regularly used in real-time applications.

Disadvantages:

  • Less flexible in response to workload or shifting system conditions.

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:

  •  Offers best performance in deadline compliance.

Disadvantages:

  • Practically verifying execution can be somewhat challenging and difficult.