Operating System Scheduling Algorithms
Operating System Scheduling Algorithms
A Process Scheduler schedules different processes to be assigned to the CPU based on particular
scheduling algorithms. There are six popular process scheduling algorithms which we are going to
discuss in this chapter −
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 1/6
5/22/22, 9:27 PM Operating System Scheduling algorithms
P0 0-0=0
P1 5-1=4
P2 8-2=6
P3 16 - 3 = 13
Easy to implement in Batch systems where required CPU time is known in advance.
Impossible to implement in interactive systems where required CPU time is not known.
The processer should know in advance how much time process will take.
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 2/6
5/22/22, 9:27 PM Operating System Scheduling algorithms
P0 0 5 0
P1 1 3 5
P2 2 8 14
P3 3 6 8
P0 0-0=0
P1 5-1=4
P2 14 - 2 = 12
P3 8-3=5
Each process is assigned a priority. Process with highest priority is to be executed first and so
on.
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 3/6
5/22/22, 9:27 PM Operating System Scheduling algorithms
Processes with same priority are executed on first come first served basis.
Priority can be decided based on memory requirements, time requirements or any other
resource requirement.
Given: Table of processes, and their Arrival time, Execution time, and priority. Here we are
considering 1 is the lowest priority.
P0 0 5 1 0
P1 1 3 2 11
P2 2 8 1 14
P3 3 6 3 5
P0 0-0=0
P1 11 - 1 = 10
P2 14 - 2 = 12
P3 5-3=2
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 4/6
5/22/22, 9:27 PM Operating System Scheduling algorithms
Impossible to implement in interactive systems where required CPU time is not known.
It is often used in batch environments where short jobs need to give preference.
Once a process is executed for a given time period, it is preempted and other process executes
for a given time period.
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P3 (9 - 3) + (17 - 12) = 11
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 5/6
5/22/22, 9:27 PM Operating System Scheduling algorithms
Multiple-level queues are not an independent scheduling algorithm. They make use of other existing
algorithms to group and schedule jobs with common characteristics.
For example, CPU-bound jobs can be scheduled in one queue and all I/O-bound jobs in another
queue. The Process Scheduler then alternately selects jobs from each queue and assigns them to
the CPU based on the algorithm assigned to the queue.
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 6/6