Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
contur::SrtPolicy Class Referencefinal

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

#include <srt_policy.h>

Inheritance diagram for contur::SrtPolicy:

Public Member Functions

std::string_view name () const noexcept override
 Policy name.
ProcessId selectNext (const std::vector< SchedulingProcessSnapshot > &readyQueue, const IClock &clock) const override
 Selects process with the shortest remaining burst.
bool shouldPreempt (const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &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< SchedulingProcessSnapshot > & readyQueue,
const IClock & clock ) const
nodiscardoverridevirtual

Selects process with the shortest remaining burst.

Implements contur::ISchedulingPolicy.

References selectNext().

Referenced by selectNext().

◆ shouldPreempt()

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

Preempts when candidate has smaller remaining burst.

Implements contur::ISchedulingPolicy.

References shouldPreempt().

Referenced by shouldPreempt().


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