Operating System Scheduling algorithms
Operating System Scheduling algorithms
Priority Scheduling
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 1/6
Page 2 of 6
P0 0-0=0
P1 5-1=4
P2 8-2=6
P3 16 - 3 = 13
The processer should know in advance how much time process will take.
P0 0 5 0
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 2/6
Page 3 of 6
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
Explore our latest online courses and learn new skills at your own pace. Enroll and
become a certified expert to boost your career.
Processes with same priority are executed on first come first served basis.
https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm 3/6
Page 4 of 6
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
Page 5 of 6
Shortest remaining time (SRT) is the preemptive version of the SJN algorithm.
The processor is allocated to the job closest to completion but it can be preempted
by a newer ready job with shorter time to completion.
It is often used in batch environments where short jobs need to give preference.
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
Page 6 of 6
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