Shortest Job First Scheduling SJF Process Scheduling in operating systems

Shortest Job First Scheduling (SJF)

Process with less burst time will always execute first.

This is a non-preemptive scheduling algorithm so processes priority does not matter.

This is a pre-emptive scheduling algorithm.

Preferred to minimize waiting time.

Better than First come first served scheduling.

Works only when processor know in advance that how much time every process will take to execute on CPU.

Not preferred for interactive systems because required CPU time is not already in knowledge.[quads id=1]

Easy to implement in Batch systems because in batch systems CPU time is already known. 

ProcessBurst TimeArrival
P142nd
P223rd
P381st
P434th

 

P2P4P1P3
0              2                5                 9         17

 

ProcessWaiting Time
P15
P20
P39
P42

Average Wait Time: (0+2+5+9) / 4 = 4

How to calculate turn around time?

TurnAroundTime=BurstTime+WaitingTime.

Program of Shortest Job First Scheduling (SJF) in C Language

Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below.Thanks and love to all for connecting with us. We are nothing without you. Love you all.....

Leave a Reply