Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::ecs::MultiThreadedExecutor Class Referencefinal

Multi-threaded executor that runs systems in parallel using work-stealing. More...

#include <multi_threaded.hpp>

Inheritance diagram for helios::ecs::MultiThreadedExecutor:
helios::ecs::Executor

Public Member Functions

 MultiThreadedExecutor (async::Executor &executor) noexcept
 Constructs a multi-threaded executor with an external async executor.
 MultiThreadedExecutor (const MultiThreadedExecutor &)=delete
 MultiThreadedExecutor (MultiThreadedExecutor &&) noexcept=default
 ~MultiThreadedExecutor () override=default
MultiThreadedExecutoroperator= (const MultiThreadedExecutor &)=delete
MultiThreadedExecutoroperator= (MultiThreadedExecutor &&) noexcept=default
void Execute (Schedule &schedule, World &world) override
 Executes the schedule using the multi-threaded executor.
void ExecuteAndWait (Schedule &schedule, World &world) override
 Executes all systems in the schedule and blocks until completion.
void Wait () override
 Waits for the most recent Execute() to complete.
Public Member Functions inherited from helios::ecs::Executor
virtual ~Executor ()=default

Detailed Description

Multi-threaded executor that runs systems in parallel using work-stealing.

Uses an injected async::Executor reference to run a async::TaskGraph that respects ordering constraints and access-policy conflicts. The async::TaskGraph and task vector are cached across frames and cleared/rebuilt each execution.

Definition at line 23 of file multi_threaded.hpp.

Constructor & Destructor Documentation

◆ MultiThreadedExecutor() [1/3]

helios::ecs::MultiThreadedExecutor::MultiThreadedExecutor ( async::Executor & executor)
inlineexplicitnoexcept

Constructs a multi-threaded executor with an external async executor.

Parameters
executorReference to the async executor for thread pool management

Definition at line 30 of file multi_threaded.hpp.

◆ MultiThreadedExecutor() [2/3]

helios::ecs::MultiThreadedExecutor::MultiThreadedExecutor ( const MultiThreadedExecutor & )
delete

◆ MultiThreadedExecutor() [3/3]

helios::ecs::MultiThreadedExecutor::MultiThreadedExecutor ( MultiThreadedExecutor && )
defaultnoexcept

◆ ~MultiThreadedExecutor()

helios::ecs::MultiThreadedExecutor::~MultiThreadedExecutor ( )
overridedefault

Member Function Documentation

◆ Execute()

void helios::ecs::MultiThreadedExecutor::Execute ( Schedule & schedule,
World & world )
overridevirtual

Executes the schedule using the multi-threaded executor.

Parameters
scheduleThe schedule to execute
worldThe world context for system execution

Implements helios::ecs::Executor.

Definition at line 101 of file multi_threaded.cpp.

◆ ExecuteAndWait()

void helios::ecs::MultiThreadedExecutor::ExecuteAndWait ( Schedule & schedule,
World & world )
overridevirtual

Executes all systems in the schedule and blocks until completion.

Default implementation calls Execute() then Wait().

Parameters
scheduleCompiled schedule to execute
worldWorld to pass to each system

Reimplemented from helios::ecs::Executor.

Definition at line 106 of file multi_threaded.cpp.

◆ operator=() [1/2]

MultiThreadedExecutor & helios::ecs::MultiThreadedExecutor::operator= ( const MultiThreadedExecutor & )
delete

◆ operator=() [2/2]

MultiThreadedExecutor & helios::ecs::MultiThreadedExecutor::operator= ( MultiThreadedExecutor && )
defaultnoexcept

◆ Wait()

void helios::ecs::MultiThreadedExecutor::Wait ( )
inlineoverridevirtual

Waits for the most recent Execute() to complete.

Blocks until the submitted task graph finishes.

Reimplemented from helios::ecs::Executor.

Definition at line 64 of file multi_threaded.hpp.