Preemptive SJF
(Shortest Remaining Time Left)

Description

Shortest job first is a scheduling algorithm in which the process with the smallest execution time is selected for execution next. Shortest job first can be either preemptive(SRTF) or non-preemptive. Owing to its simple nature, shortest job first is considered optimal. It also reduces the average waiting time for other processes awaiting execution.

This page will demonsrate Preemptive SJF. In this scheduling system the shortest process is selected and processed as long as a new process arrives. If the new process has a smaller burst time than the remaining burst time of the current process then the current process is interupted and the new (Just arrived) process is executed.

Example & Simulation

Example #1

Process Arrival Time Burst Time
P1 0 3
P2 1 1
P3 2 2
P4 4 1
P5 6 3
P6 8 1
Run Simulation

Example #2

Process Arrival Time Burst Time
P1 8 1
P2 5 1
P3 2 7
P4 4 3
P5 2 8
P6 4 2
P7 3 5
Run Simulation

Try It Yourself!

PROCESS
Process Arrival Time Burst Time
P1
Add Row
Run Simulation

0

Process Remaining Waiting Turnaround Status
Print Result

Process Waiting Turnaround