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

Dynamic-priority scheduling policy. More...

#include <priority_policy.h>

Inheritance diagram for contur::PriorityPolicy:

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 effective priority.
bool shouldPreempt (const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &candidate, const IClock &clock) const override
 Preempts when candidate priority outranks running process.
Public Member Functions inherited from contur::ISchedulingPolicy
virtual ~ISchedulingPolicy ()=default

Detailed Description

Dynamic-priority scheduling policy.

Selects process with best effective priority and supports preemption when a higher-priority candidate becomes ready.

Definition at line 14 of file priority_policy.h.

Member Function Documentation

◆ name()

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

Policy name.

Implements contur::ISchedulingPolicy.

◆ selectNext()

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

Selects process with highest effective priority.

Implements contur::ISchedulingPolicy.

References selectNext().

Referenced by selectNext().

◆ shouldPreempt()

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

Preempts when candidate priority outranks running process.

Implements contur::ISchedulingPolicy.

References shouldPreempt().

Referenced by shouldPreempt().


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