Distributed Operating System Lab 7
Distributed Operating System Lab 7
After completing this manual, you will able to learn how to simulate SJF Scheduling Algorithm.
SJF: Shortest Job First (SJF) is a type of disk scheduling algorithm in the operating system in
which the processor executes the job first that has the smallest execution time. In the shortest Job
First algorithm, the processes are scheduled according to the burst time of these processes.
AIM: Using CPU scheduling algorithms find the min & max waiting time.
THEORY:
Example of Non-Preemptive SJF
Process Arrival Burst
time Time
7
P1 0.0
P2 2.0 4
P3 4.0 1
P4 3.0 4
P1 P2 P3 P4
0 7 8 12 16
P1 P2 P3 P2 P4 P1
0 2 4 5 7 11 16
HW: Write a program to implement preemptive shortest job first (SJF) scheduling algorithm.