![]() |
Contur 2
Educational OS kernel simulator
|
Round Robin scheduling policy. More...
#include <round_robin_policy.h>
Public Member Functions | |
| RoundRobinPolicy (std::size_t timeSlice) | |
| Constructs Round Robin policy. | |
| std::string_view | name () const noexcept override |
| Policy name. | |
| ProcessId | selectNext (const std::vector< SchedulingProcessSnapshot > &readyQueue, const IClock &clock) const override |
| Selects the next process in round-robin queue order. | |
| bool | shouldPreempt (const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &candidate, const IClock &clock) const override |
| Returns true if running process exhausted its slice. | |
| std::size_t | timeSlice () const noexcept |
| Configured time slice. | |
| Public Member Functions inherited from contur::ISchedulingPolicy | |
| virtual | ~ISchedulingPolicy ()=default |
Private Attributes | |
| std::size_t | timeSlice_ |
Round Robin scheduling policy.
Uses fixed-size time slices and preempts when the running process consumes its configured budget.
Definition at line 16 of file round_robin_policy.h.
|
explicit |
Constructs Round Robin policy.
| timeSlice | Maximum ticks a process can run before preemption. |
References timeSlice().
|
nodiscardoverridevirtualnoexcept |
Policy name.
Implements contur::ISchedulingPolicy.
|
nodiscardoverridevirtual |
Selects the next process in round-robin queue order.
Implements contur::ISchedulingPolicy.
References selectNext().
Referenced by selectNext().
|
nodiscardoverridevirtual |
Returns true if running process exhausted its slice.
Implements contur::ISchedulingPolicy.
References shouldPreempt().
Referenced by shouldPreempt().
|
nodiscardnoexcept |
|
private |
Definition at line 39 of file round_robin_policy.h.