Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
hrrn_policy.h
Go to the documentation of this file.
1
3
4#pragma once
5
7
8namespace contur {
9
14 class HrrnPolicy final : public ISchedulingPolicy
15 {
16 public:
18 [[nodiscard]] std::string_view name() const noexcept override;
19
21 [[nodiscard]] ProcessId
22 selectNext(const std::vector<SchedulingProcessSnapshot> &readyQueue, const IClock &clock) const override;
23
25 [[nodiscard]] bool shouldPreempt(
26 const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &candidate, const IClock &clock
27 ) const override;
28 };
29
30} // namespace contur
Highest Response Ratio Next (HRRN) scheduling policy.
Definition hrrn_policy.h:15
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.
std::string_view name() const noexcept override
Policy name.
Abstract clock interface for simulation time.
Definition clock.h:21
Strategy interface for scheduling algorithms.
ISchedulingPolicy interface for pluggable scheduling algorithms.
Definition block.h:15
std::uint32_t ProcessId
Unique identifier for a process.
Definition types.h:12
Immutable process view consumed by scheduling policies.