Professional Documents
Culture Documents
Marnin Audu Assignment 3
Marnin Audu Assignment 3
Introduction
To ensure that the CPU operates optimally allowing the consistent flow of data back and forth.
To achieve this CPU scheduling was developed and there are different types of CPU scheduling but the
most common type is called Shortest Job First Algorithm.
Shortest job first also known as Shortest Job next is a type a CPU scheduling stated earlier. It simply
works by selecting the task with Shortest execution time to be executed next.
How it works
Types
1. Pre-emotive: in pre-emtive SJF as jobs arrive they’re put in the ready queue and are executed
sequentially just ad they arrived since they all have the same execution time.
2. Non Pre-emptive: here the arrival time for the tasks vary and as such the task with the Shortest
burst time is then given priority.
Note: for this system to be used effectively the burst time of each process should be known to the
CPU ahead of time, which isn’t practically possible.
The algorithm is best used for batch systems where the tasks have the same arrival time.