![]() |
Contur 2
Educational OS kernel simulator
|
Multilevel Feedback Queue (MLFQ) scheduling policy. More...
#include <mlfq_policy.h>
Public Member Functions | |
| MlfqPolicy (std::vector< std::size_t > levelTimeSlices={1, 2, 4}) | |
| Constructs MLFQ policy. | |
| std::string_view | name () const noexcept override |
| Policy name. | |
| ProcessId | selectNext (const std::vector< SchedulingProcessSnapshot > &readyQueue, const IClock &clock) const override |
| Selects next process according to MLFQ level ordering. | |
| bool | shouldPreempt (const SchedulingProcessSnapshot &running, const SchedulingProcessSnapshot &candidate, const IClock &clock) const override |
| Returns true when running process should be preempted. | |
| const std::vector< std::size_t > & | levelTimeSlices () const noexcept |
| Configured level time slices. | |
| Public Member Functions inherited from contur::ISchedulingPolicy | |
| virtual | ~ISchedulingPolicy ()=default |
Private Attributes | |
| std::vector< std::size_t > | levelTimeSlices_ |
Multilevel Feedback Queue (MLFQ) scheduling policy.
Classifies processes across multiple priority levels with distinct time slices and adapts scheduling behavior from runtime feedback.
Definition at line 17 of file mlfq_policy.h.
|
explicit |
Constructs MLFQ policy.
| levelTimeSlices | Time slice per level (highest to lowest). |
References levelTimeSlices().
|
nodiscardnoexcept |
Configured level time slices.
References levelTimeSlices().
Referenced by levelTimeSlices(), and MlfqPolicy().
|
nodiscardoverridevirtualnoexcept |
Policy name.
Implements contur::ISchedulingPolicy.
|
nodiscardoverridevirtual |
Selects next process according to MLFQ level ordering.
Implements contur::ISchedulingPolicy.
References selectNext().
Referenced by selectNext().
|
nodiscardoverridevirtual |
Returns true when running process should be preempted.
Implements contur::ISchedulingPolicy.
References shouldPreempt().
Referenced by shouldPreempt().
|
private |
Definition at line 40 of file mlfq_policy.h.