Home

SRTF

SRTF, or Shortest Remaining Time First, is a preemptive CPU scheduling algorithm used in operating systems. It is the preemptive variant of the Shortest Job First strategy. The scheduler always runs the ready process with the smallest remaining CPU burst time. If a new process arrives whose total burst time is shorter than the remaining time of the currently running process, the current process is preempted and the new process begins execution.

Implementation typically uses a priority queue or min-heap keyed by remaining burst time. Each arrival or completion

Advantages of SRTF include reduced average waiting time (and often reduced turnaround time) for workloads with

Disadvantages include potential starvation of long processes if many short jobs keep arriving, as well as the

Relation to other schedulers: SRTF is the preemptive counterpart to SJF. Unlike non-preemptive SJF, SRTF can

Notes: SRTF is commonly discussed in scheduling theory and education. In practical systems, exact burst times

can
trigger
a
preemption
decision.
Because
the
algorithm
relies
on
knowledge
of
remaining
times,
it
assumes
either
exact
burst
lengths
or
estimates.
In
practice,
remaining
times
are
often
updated
using
historical
data
or
exponential
averaging
to
provide
forecasts.
a
mix
of
short
and
long
processes,
and
improved
responsiveness
for
short
tasks
in
interactive
systems.
It
is
particularly
effective
when
short
jobs
arrive
frequently.
overhead
from
frequent
preemptions
and
context
switches.
The
algorithm
also
depends
on
accurate
or
reliable
burst-time
estimates,
which
may
not
always
be
available.
interrupt
a
running
process
to
start
a
shorter
one,
which
can
improve
short-job
performance
but
increase
scheduling
complexity
and
overhead.
are
rarely
known,
so
variants
use
estimates,
making
the
behavior
approximate
rather
than
exact.