Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
contur::HostThreadingConfig Struct Reference

Configuration for host-thread dispatch runtime behavior. More...

#include <threading_config.h>

Public Member Functions

constexpr bool isValid () const noexcept
 Returns true when this config satisfies minimum runtime requirements.
constexpr bool isSingleThreaded () const noexcept
 Returns true when the runtime is configured for a single host thread.
constexpr HostThreadingConfig normalized () const noexcept
 Returns a normalized copy with safe baseline invariants.
constexpr void normalize () noexcept
 Normalizes this instance in place.

Public Attributes

std::size_t hostThreadCount = 1
 Number of host worker threads (must be >= 1).
bool deterministicMode = true
 Enables deterministic scheduling checkpoints for multithreaded runs.
bool workStealingEnabled = false
 Enables work stealing between worker lanes when multithreading is active.

Detailed Description

Configuration for host-thread dispatch runtime behavior.

Definition at line 11 of file threading_config.h.

Member Function Documentation

◆ isSingleThreaded()

bool contur::HostThreadingConfig::isSingleThreaded ( ) const
inlinenodiscardconstexprnoexcept

Returns true when the runtime is configured for a single host thread.

Definition at line 29 of file threading_config.h.

References hostThreadCount.

Referenced by normalized().

◆ isValid()

bool contur::HostThreadingConfig::isValid ( ) const
inlinenodiscardconstexprnoexcept

Returns true when this config satisfies minimum runtime requirements.

Definition at line 23 of file threading_config.h.

References hostThreadCount.

◆ normalize()

void contur::HostThreadingConfig::normalize ( )
inlineconstexprnoexcept

Normalizes this instance in place.

Definition at line 53 of file threading_config.h.

References normalized().

◆ normalized()

HostThreadingConfig contur::HostThreadingConfig::normalized ( ) const
inlinenodiscardconstexprnoexcept

Returns a normalized copy with safe baseline invariants.

Definition at line 35 of file threading_config.h.

References hostThreadCount, isSingleThreaded(), and workStealingEnabled.

Referenced by normalize().

Member Data Documentation

◆ deterministicMode

bool contur::HostThreadingConfig::deterministicMode = true

Enables deterministic scheduling checkpoints for multithreaded runs.

Definition at line 17 of file threading_config.h.

◆ hostThreadCount

std::size_t contur::HostThreadingConfig::hostThreadCount = 1

Number of host worker threads (must be >= 1).

Definition at line 14 of file threading_config.h.

Referenced by isSingleThreaded(), isValid(), and normalized().

◆ workStealingEnabled

bool contur::HostThreadingConfig::workStealingEnabled = false

Enables work stealing between worker lanes when multithreading is active.

Definition at line 20 of file threading_config.h.

Referenced by normalized().


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