83 [[nodiscard]]
virtual std::size_t
laneCount() const noexcept = 0;
124 [[nodiscard]] virtual std::string_view
policyName() const noexcept = 0;
Abstract clock interface for simulation time.
Scheduler abstraction managing process state queues.
virtual std::size_t laneCount() const noexcept=0
Returns number of configured scheduler lanes.
virtual Result< ProcessId > stealNextForLane(std::size_t thiefLane, const IClock &clock)=0
Steals one ready process from another lane and schedules it on thief lane.
virtual Result< void > setPolicy(std::unique_ptr< ISchedulingPolicy > policy)=0
Replaces scheduling policy at runtime.
virtual Result< void > blockRunning(Tick currentTick)=0
Moves current running process to blocked queue.
virtual Result< void > dequeue(ProcessId pid)=0
Removes a process from scheduler ownership/queues.
virtual Result< void > configureLanes(std::size_t laneCount)=0
Configures scheduler lane count used for per-core ready queues.
virtual std::vector< ProcessId > runningProcesses() const =0
Returns currently running process IDs across scheduler lanes.
virtual Result< ProcessId > selectNextForLane(std::size_t laneIndex, const IClock &clock)=0
Selects/runs next process on a specific lane.
virtual std::vector< ProcessId > getBlockedSnapshot() const =0
Returns blocked queue PID snapshot.
virtual Result< void > enqueueToLane(PCB &pcb, std::size_t laneIndex, Tick currentTick)=0
Enqueues process into a specific ready lane.
virtual ~IScheduler()=default
virtual Result< void > enqueue(PCB &pcb, Tick currentTick)=0
Enqueues a process into the ready queue.
virtual Result< void > blockProcess(ProcessId pid, Tick currentTick)=0
Moves a specific running or ready process to the blocked queue.
virtual Result< void > unblock(ProcessId pid, Tick currentTick)=0
Moves a blocked process back to ready queue.
virtual std::vector< std::vector< ProcessId > > getPerLaneQueueSnapshot() const =0
Returns per-lane ready queue snapshots.
virtual Result< void > terminate(ProcessId pid, Tick currentTick)=0
Marks process as terminated and removes it from active queues.
virtual Result< ProcessId > selectNext(const IClock &clock)=0
Selects the process to run next.
virtual std::vector< ProcessId > getQueueSnapshot() const =0
Returns ready queue PID snapshot.
virtual std::string_view policyName() const noexcept=0
Returns active policy name or "Unconfigured".
Strategy interface for scheduling algorithms.
Process Control Block — stores all metadata for a single process.
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.
std::uint64_t Tick
Simulation clock tick counter.
std::uint32_t ProcessId
Unique identifier for a process.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...