contur2
Loading...
Searching...
No Matches
contur::SrtPolicy Class Referencefinal

Shortest Remaining Time (SRT) scheduling policy. More...

#include <srt_policy.h>

Inheritance diagram for contur::SrtPolicy:
Collaboration diagram for contur::SrtPolicy:

Public Member Functions

std::string_view name () const noexcept override
 Policy name.
ProcessId selectNext (const std::vector< std::reference_wrapper< const PCB > > &readyQueue, const IClock &clock) const override
 Selects process with the shortest remaining burst.
bool shouldPreempt (const PCB &running, const PCB &candidate, const IClock &clock) const override
 Preempts when candidate has smaller remaining burst.
Public Member Functions inherited from contur::ISchedulingPolicy
virtual ~ISchedulingPolicy ()=default

Detailed Description

Shortest Remaining Time (SRT) scheduling policy.

Selects process with minimal remaining estimated CPU burst and allows preemption by shorter candidates.

Definition at line 14 of file srt_policy.h.

Member Function Documentation

◆ name()

std::string_view contur::SrtPolicy::name ( ) const
nodiscardoverridevirtualnoexcept

Policy name.

Implements contur::ISchedulingPolicy.

◆ selectNext()

ProcessId contur::SrtPolicy::selectNext ( const std::vector< std::reference_wrapper< const PCB > > & readyQueue,
const IClock & clock ) const
nodiscardoverridevirtual

Selects process with the shortest remaining burst.

Implements contur::ISchedulingPolicy.

◆ shouldPreempt()

bool contur::SrtPolicy::shouldPreempt ( const PCB & running,
const PCB & candidate,
const IClock & clock ) const
nodiscardoverridevirtual

Preempts when candidate has smaller remaining burst.

Implements contur::ISchedulingPolicy.


The documentation for this class was generated from the following file: