Toast Engine
Loading...
Searching...
No Matches
wave_executor.hpp File Reference

Runs a plan of jobs on the thread pool, one interpreter per job. More...

#include <cstddef>
#include <memory>
#include <toast/export.hpp>
#include <type_traits>
#include <vector>
Include dependency graph for wave_executor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  toast::_detail::WaveJob
class  toast::_detail::ItemRunner
struct  toast::_detail::ExecuteOptions

Namespaces

namespace  toast::_detail
 Member-robber pattern used by the generated reflection code.

Functions

void toast::_detail::runJobs (const std::vector< WaveJob > &jobs, size_t item_count, ItemRunner run_item, const ExecuteOptions &options={})
 Runs the jobs of a plan in parallel and returns once every item has run.

Detailed Description

Runs a plan of jobs on the thread pool, one interpreter per job.

Author
Xein
Date
6 Oct 2026

Whatever has to run Lua on one interpreter is one job, and a job's items run one after the other, so an interpreter is only ever used by one worker at a time and nothing waits for another worker's interpreter. The tick waves, the construction of scripts in a prefab and the init/begin of a tree all run through here