contur2
Loading...
Searching...
No Matches
contur::ExecutionResult Struct Reference

Result of an execution burst returned by IExecutionEngine::execute(). More...

#include <execution_context.h>

Static Public Member Functions

static constexpr ExecutionResult budgetExhausted (ProcessId pid, std::size_t ticks) noexcept
 Creates a result for budget exhaustion (preemption).
static constexpr ExecutionResult exited (ProcessId pid, std::size_t ticks) noexcept
 Creates a result for normal process exit.
static constexpr ExecutionResult error (ProcessId pid, std::size_t ticks, Interrupt intr) noexcept
 Creates a result for an error condition.
static constexpr ExecutionResult interrupted (ProcessId pid, std::size_t ticks, Interrupt intr) noexcept
 Creates a result for an interrupt requiring kernel attention.
static constexpr ExecutionResult halted (ProcessId pid, std::size_t ticks) noexcept
 Creates a result for a forcibly halted process.

Public Attributes

StopReason reason = StopReason::Error
 Why execution stopped.
Interrupt interrupt = Interrupt::Ok
 The interrupt that caused the stop (if Interrupted).
std::size_t ticksConsumed = 0
 Number of ticks actually executed.
ProcessId pid = INVALID_PID
 The process that was executing.

Detailed Description

Result of an execution burst returned by IExecutionEngine::execute().

The dispatcher inspects this to decide how to transition the process:

  • BudgetExhausted → move to Ready (preempted)
  • ProcessExited → move to Terminated
  • Error → move to Terminated (with error)
  • Interrupted → handle the interrupt (syscall dispatch, I/O, etc.)
  • Halted → move to Terminated (forced)

Definition at line 36 of file execution_context.h.

Member Function Documentation

◆ budgetExhausted()

constexpr ExecutionResult contur::ExecutionResult::budgetExhausted ( ProcessId pid,
std::size_t ticks )
inlinestaticnodiscardconstexprnoexcept

Creates a result for budget exhaustion (preemption).

Definition at line 44 of file execution_context.h.

◆ error()

constexpr ExecutionResult contur::ExecutionResult::error ( ProcessId pid,
std::size_t ticks,
Interrupt intr )
inlinestaticnodiscardconstexprnoexcept

Creates a result for an error condition.

Definition at line 56 of file execution_context.h.

◆ exited()

constexpr ExecutionResult contur::ExecutionResult::exited ( ProcessId pid,
std::size_t ticks )
inlinestaticnodiscardconstexprnoexcept

Creates a result for normal process exit.

Definition at line 50 of file execution_context.h.

◆ halted()

constexpr ExecutionResult contur::ExecutionResult::halted ( ProcessId pid,
std::size_t ticks )
inlinestaticnodiscardconstexprnoexcept

Creates a result for a forcibly halted process.

Definition at line 69 of file execution_context.h.

◆ interrupted()

constexpr ExecutionResult contur::ExecutionResult::interrupted ( ProcessId pid,
std::size_t ticks,
Interrupt intr )
inlinestaticnodiscardconstexprnoexcept

Creates a result for an interrupt requiring kernel attention.

Definition at line 63 of file execution_context.h.

Member Data Documentation

◆ interrupt

Interrupt contur::ExecutionResult::interrupt = Interrupt::Ok

The interrupt that caused the stop (if Interrupted).

Definition at line 39 of file execution_context.h.

◆ pid

ProcessId contur::ExecutionResult::pid = INVALID_PID

The process that was executing.

Definition at line 41 of file execution_context.h.

◆ reason

StopReason contur::ExecutionResult::reason = StopReason::Error

Why execution stopped.

Definition at line 38 of file execution_context.h.

◆ ticksConsumed

std::size_t contur::ExecutionResult::ticksConsumed = 0

Number of ticks actually executed.

Definition at line 40 of file execution_context.h.


The documentation for this struct was generated from the following file: