载入中...
搜索中...
未找到
Thread.cpp
浏览该文件的文档.
Capability for submitting CPU work onto a worker pool.
Stable, structured diagnostics shared by engine modules.
Move-only, checked operation results for the common layer.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
virtual const char * what() const
Returns a string containing reason for the exception.
Definition Exception.h:24
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Fire-and-forget CPU job submission used by the resource cache.
Definition AsyncWork.h:26
Thread-safe message queue (love2d-style Channel). Values are strings so the API stays overload-free f...
Definition Channel.h:19
std::string supply(int timeoutMs)
Block up to timeoutMs; returns "" on timeout.
Definition Channel.cpp:42
Abstract job scheduler: dependencies, parallel_for, task_group, arena.
Definition JobSystem.h:157
Fixed-size worker pool. Owns worker std::threads; tasks run FIFO. Squirrel VM is not thread-safe — do...
Definition ThreadPool.h:26
void waitAll()
Block until idle. Throws when called by a worker belonging to this pool.
Definition ThreadPool.cpp:156
Task * submitSleep(int ms)
Sleep on a worker, then mark done — useful from scripts / tests.
Definition ThreadPool.cpp:109
void stop()
Stop accepting work and join workers. Worker calls are rejected. Idempotent.
Definition ThreadPool.cpp:164
Task * submitPost(std::string name, std::string data="", int delayMs=0)
Sleep, then post an Event on the main queue (thread-safe). Scripts poll via event....
Definition ThreadPool.cpp:134
Task * submitPush(Channel *channel, std::string message, int delayMs=0)
Sleep, then push a message onto a channel (cross-thread signalling).
Definition ThreadPool.cpp:117
Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThread...
Definition Thread.h:24
void postMain(std::string eventName, std::string data="")
Thread-safe post onto the Event module queue (any thread). Main loop: event.pump is unrelated; just e...
Definition Thread.cpp:103
Channel * newChannel()
Anonymous channel (not registered in the name map). @ownership Owned; caller must delete when done....
Definition Thread.cpp:101
ThreadPool * getPool()
Shared default pool (created lazily with hardwareConcurrency workers). @ownership Borrowed from this ...
Definition Thread.cpp:68
JobSystem * getJobSystem()
Shared engine-wide JobSystem (created lazily with hardware concurrency workers). Use it for dependenc...
Definition Thread.cpp:81
ThreadPool * newThreadPool(int workerCount=0)
Create an independent pool. @ownership Owned; caller must delete when done. @lifetime Valid until the...
Definition Thread.cpp:75
Channel * getChannel(std::string channelName)
Named shared channel (love2d-style). Same name → same Channel instance for the lifetime of the module...
Definition Thread.cpp:88
JobSystem * createJobSystem(int workerCount)
Create a JobSystem with the configured backend.
Definition JobSystem.cpp:14
@ InvalidArgument
@ Failed
@ Applied
Definition Container.h:602