Scheduler abstraction managing process state queues.
More...
#include <i_scheduler.h>
Scheduler abstraction managing process state queues.
Coordinates ready/blocked/running process sets and delegates process ordering decisions to the active ISchedulingPolicy implementation.
Definition at line 22 of file i_scheduler.h.
◆ ~IScheduler()
| virtual contur::IScheduler::~IScheduler |
( |
| ) |
|
|
virtualdefault |
◆ blockRunning()
| virtual Result< void > contur::IScheduler::blockRunning |
( |
Tick | currentTick | ) |
|
|
nodiscardpure virtual |
Moves current running process to blocked queue.
- Parameters
-
| currentTick | Simulation tick for blocked queue timing metadata. |
- Returns
- Ok on success; error if no process is currently running.
Implemented in contur::Scheduler.
◆ dequeue()
Removes a process from scheduler ownership/queues.
- Parameters
-
| pid | Identifier of the process to remove. |
- Returns
- Ok on success; error if pid is unknown.
Implemented in contur::Scheduler.
◆ enqueue()
| virtual Result< void > contur::IScheduler::enqueue |
( |
PCB & | pcb, |
|
|
Tick | currentTick ) |
|
nodiscardpure virtual |
Enqueues a process into the ready queue.
- Parameters
-
| pcb | Process control block to add. |
| currentTick | Simulation tick used for queue timing metadata. |
- Returns
- Ok on success; error if enqueueing is invalid for current state.
Implemented in contur::Scheduler.
◆ getBlockedSnapshot()
| virtual std::vector< ProcessId > contur::IScheduler::getBlockedSnapshot |
( |
| ) |
const |
|
nodiscardpure virtual |
Returns blocked queue PID snapshot.
- Returns
- Ordered list of process identifiers currently in the blocked queue.
Implemented in contur::Scheduler.
◆ getQueueSnapshot()
| virtual std::vector< ProcessId > contur::IScheduler::getQueueSnapshot |
( |
| ) |
const |
|
nodiscardpure virtual |
Returns ready queue PID snapshot.
- Returns
- Ordered list of process identifiers currently in the ready queue.
Implemented in contur::Scheduler.
◆ runningProcess()
| virtual ProcessId contur::IScheduler::runningProcess |
( |
| ) |
const |
|
nodiscardpure virtualnoexcept |
Returns currently running process, or INVALID_PID.
- Returns
- Running process identifier, or INVALID_PID if CPU is idle.
Implemented in contur::Scheduler.
◆ selectNext()
Selects the process to run next.
- Parameters
-
| clock | Simulation clock for time-aware policy decisions. |
- Returns
- Selected process identifier, or error if no runnable process exists.
Implemented in contur::Scheduler.
◆ setPolicy()
Replaces scheduling policy at runtime.
- Parameters
-
| policy | New scheduling policy instance. |
- Returns
- Ok on success; error if policy is null or unsupported.
Implemented in contur::Scheduler.
◆ terminate()
Marks process as terminated and removes it from active queues.
- Parameters
-
| pid | Identifier of the process to terminate. |
| currentTick | Simulation tick used for final accounting. |
- Returns
- Ok on success; error if pid is unknown.
Implemented in contur::Scheduler.
◆ unblock()
Moves a blocked process back to ready queue.
- Parameters
-
| pid | Identifier of the blocked process. |
| currentTick | Simulation tick used when re-enqueueing. |
- Returns
- Ok on success; error if pid is not blocked.
Implemented in contur::Scheduler.
The documentation for this class was generated from the following file: