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

Highest Response Ratio Next (HRRN) scheduling policy. More...

#include <hrrn_policy.h>

Inheritance diagram for contur::HrrnPolicy:

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 highest response ratio.
bool shouldPreempt (const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &candidate, const IClock &clock) const override
 HRRN is non-preemptive once process is running.
Public Member Functions inherited from contur::ISchedulingPolicy
virtual ~ISchedulingPolicy ()=default

Detailed Description

Highest Response Ratio Next (HRRN) scheduling policy.

Selects process maximizing response ratio: (waiting_time + service_time) / service_time.

Definition at line 14 of file hrrn_policy.h.

Member Function Documentation

◆ name()

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

Policy name.

Implements contur::ISchedulingPolicy.

◆ selectNext()

ProcessId contur::HrrnPolicy::selectNext ( const std::vector< SchedulingProcessSnapshot > & readyQueue,
const IClock & clock ) const
nodiscardoverridevirtual

Selects process with highest response ratio.

Implements contur::ISchedulingPolicy.

References selectNext().

Referenced by selectNext().

◆ shouldPreempt()

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

HRRN is non-preemptive once process is running.

Implements contur::ISchedulingPolicy.

References shouldPreempt().

Referenced by shouldPreempt().


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