Abstract clock interface for simulation time.
Scheduler abstraction managing process state queues.
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 std::vector< ProcessId > getBlockedSnapshot() const =0
Returns blocked queue PID snapshot.
virtual ~IScheduler()=default
virtual Result< void > enqueue(PCB &pcb, Tick currentTick)=0
Enqueues a process into the ready queue.
virtual Result< void > unblock(ProcessId pid, Tick currentTick)=0
Moves a blocked process back to ready queue.
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 ProcessId runningProcess() const noexcept=0
Returns currently running process, or INVALID_PID.
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...