You are on page 1of 8

The Shortest Job First (SJf)

IS Department
Operating System: 22IS303
Team 8:
Yallappagouda 4MC22IS123
Varun gowda 4MC22IS121
Course Coordinator: Priyanka mam.
CONTENTS

01 Shortest Job First 03 Problems

02 Types of SJF 04 Program


Types Of SJF:
1.Non preemptive
2.preemptive

Arrival Time
Burst time
Ready Queue
Execution time
Completion time
Waiting time=(TAT-BT)
Turnaround time=(CT-AT)
Question: Non Premitive method
Procees Burst time

P1 6

P2 8

P3 7

P4 3
Waiting Time (WT) is the total time the process spends
Solution: waiting in the ready queue before getting CPU time.

:GANTT CHART: WT(P1) = 3


WT(P2) = 8
Time 0 3 9 16 24 WT(P3) = 9
Process P4 P1 P3 P2 WT(P4) = 0

Average Turnaround Time and Average Waiting Time:


Turnaround Time (TAT) is the total time taken from the
Average Turnaround Time (ATAT) = (TAT(P1) + TAT(P2) +
arrival of the process to its completion.
TAT(P3) + TAT(P4))
TAT(P1) = 9 - 0 = 9
ATAT = (9 + 16 + 13 + 3) / 4 = 10.25
TAT(P2) = 16 - 0 = 16
TAT(P3) = 16 - 3 = 13
Average Waiting Time (AWT) = (WT(P1) + WT(P2) + WT(P3)
TAT(P4) = 3
+ WT(P4))

AWT = (3 + 8 + 9 + 0) / 4 = 5
Question: Premitive method
Enter title

Procees Arrival time Burst time

P1 0 Enter title
10
Click here to add content
of the text
P2 3 6

P3 7 1

P4 8 3
GANTT CHART:

0 3 7 8 10 13 20
P1 P2 P3 P2 P4 P1

AVG TURNAROUND TIME:8.25


milisecs
AVG WAITING TIME:3.25 milisecs
Thank You

You might also like