SJF Scheduling | SRTF | CPU Scheduling

PRACTICE PROBLEMS BASED ON SJF SCHEDULING-

Problem-01:

Consider the set of 5 processes whose arrival time and burst time are given below-

If the CPU scheduling policy is SJF non-preemptive, calculate the average waiting time and average turn around time.

Solution-

Gantt Chart-

Problem-02:

Consider the set of 5 processes whose arrival time and burst time are given below-

If the CPU scheduling policy is SJF preemptive, calculate the average waiting time and average turn around time.

Solution-

Gantt Chart-

Problem-03:

Consider the set of 6 processes whose arrival time and burst time are given below-

If the CPU scheduling policy is shortest remaining time first, calculate the average waiting time and average turn around time.

Solution-

Gantt Chart-

Problem-04:

Consider the set of 3 processes whose arrival time and burst time are given below-

If the CPU scheduling policy is SRTF, calculate the average waiting time and average turn around time.

Solution-

Gantt Chart-

Problem-05:

Consider the set of 4 processes whose arrival time and burst time are given below-

If the CPU scheduling policy is SRTF, calculate the waiting time of process P2.

Solution-

Gantt Chart-

Implementation of Algorithm-

To gain better understanding about SJF Scheduling,

Get more notes and other study material of Operating System.

Watch video lectures by visiting our YouTube channel LearnVidFun.

SJF Scheduling | SRTF | CPU Scheduling

Article Name SJF Scheduling | SRTF | CPU Scheduling Description

Shortest Job First or SJF Scheduling is a CPU Scheduling Algorithm that assigns CPU to the process with smallest burst time. Shortest Remaining Time First (SRTF) guarantees the minimal average waiting time and is optimal.