Round Robin scheduling policy.
More...
#include <round_robin_policy.h>
|
| | RoundRobinPolicy (std::size_t timeSlice) |
| | Constructs Round Robin policy.
|
| std::string_view | name () const noexcept override |
| | Policy name.
|
| ProcessId | selectNext (const std::vector< std::reference_wrapper< const PCB > > &readyQueue, const IClock &clock) const override |
| | Selects the next process in round-robin queue order.
|
| bool | shouldPreempt (const PCB &running, const PCB &candidate, const IClock &clock) const override |
| | Returns true if running process exhausted its slice.
|
| std::size_t | timeSlice () const noexcept |
| | Configured time slice.
|
| virtual | ~ISchedulingPolicy ()=default |
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.
◆ RoundRobinPolicy()
| contur::RoundRobinPolicy::RoundRobinPolicy |
( |
std::size_t | timeSlice | ) |
|
|
explicit |
Constructs Round Robin policy.
- Parameters
-
| timeSlice | Maximum ticks a process can run before preemption. |
◆ name()
| std::string_view contur::RoundRobinPolicy::name |
( |
| ) |
const |
|
nodiscardoverridevirtualnoexcept |
◆ selectNext()
| ProcessId contur::RoundRobinPolicy::selectNext |
( |
const std::vector< std::reference_wrapper< const PCB > > & | readyQueue, |
|
|
const IClock & | clock ) const |
|
nodiscardoverridevirtual |
◆ shouldPreempt()
| bool contur::RoundRobinPolicy::shouldPreempt |
( |
const PCB & | running, |
|
|
const PCB & | candidate, |
|
|
const IClock & | clock ) const |
|
nodiscardoverridevirtual |
◆ timeSlice()
| std::size_t contur::RoundRobinPolicy::timeSlice |
( |
| ) |
const |
|
nodiscardnoexcept |
◆ timeSlice_
| std::size_t contur::RoundRobinPolicy::timeSlice_ |
|
private |
The documentation for this class was generated from the following file: