Operating System :: Process Management - Discussion
18 / 41
Shortest Job First executes first the job
Awith the least processor needs
Bthat first entered the queue
Cthat has been in the queue for the longest
Dthat last entered the queue
Show Explanation
Shortest Job First(SJF) scheduling: The basic principle of SJF algorithm is to allocate the CPU to the process with least CPU burst time. The processes are available in the ready queue. CPU is always assigned to the process with least CPU burst time requirements.
Example-
Process | CPU burst time |
P1 | 5 |
P2 | 10 |
P3 | 8 |
P4 | 3 |
Since, the process with smallest CPU burst time is executed first, so these processes would be scheduled in P4 --> P1 --> P3 --> P2 order. SO, average waiting time = (0+3+8+16) / 4 = 6.75 ms.
SJF is an optimal algorithm since this algorithm gives minimum average waiting rime.
Asked In ::
Shortest Job First(SJF) scheduling: The basic principle of SJF algorithm is to allocate the CPU to the process with least CPU burst time. The processes are available in the ready queue. CPU is always assigned to the process with least CPU burst time requirements.
Example-
Process | CPU burst time |
P1 | 5 |
P2 | 10 |
P3 | 8 |
P4 | 3 |
Since, the process with smallest CPU burst time is executed first, so these processes would be scheduled in P4 --> P1 --> P3 --> P2 order. SO, average waiting time = (0+3+8+16) / 4 = 6.75 ms.
SJF is an optimal algorithm since this algorithm gives minimum average waiting rime.
Read Full Answer
Report Error
Please Login First Click Here