载入中...
搜索中...
未找到
eve::thread 命名空间参考

class  Channel
 Thread-safe message queue (love2d-style Channel). Values are strings so the API stays overload-free for Squirrel bindings. Exposed to scripts as "ThreadChannel" (network already owns "Channel"). 更多...
 
class  Job
 Handle to a single job inside a JobSystem. 更多...
 
class  JobSystem
 Abstract job scheduler: dependencies, parallel_for, task_group, arena. 更多...
 
class  JobSystemThreadPool
 Default JobSystem backend: a dependency-aware scheduler over the existing ThreadPool worker pool. 更多...
 
class  Task
 A job executed by a ThreadPool worker. Status strings (no enums): "pending" | "running" | "done" | "failed". 更多...
 
class  TaskGroup
 Fork/join group: fork() spawns scheduled children, wait() joins them. 更多...
 
class  Thread
 Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThreadPool / getChannel / newChannel. 更多...
 
class  ThreadPool
 Fixed-size worker pool. Owns worker std::threads; tasks run FIFO. Squirrel VM is not thread-safe — do not call into scripts from workers. 更多...
 

类型定义

using JobFunc = std::function< void()>
 A unit of work executed by a JobSystem worker.
 
using ParallelForBody = std::function< void(int first, int last)>
 Body of a parallel_for subrange.
 

函数

JobSystemcreateJobSystem (int workerCount=0)
 Create a JobSystem with the configured backend.
 
 Module_IMPL (Thread, new Thread())
 

类型定义说明

◆ JobFunc

using eve::thread::JobFunc = typedef std::function<void()>

A unit of work executed by a JobSystem worker.

在文件 JobSystem.h15 行定义.

◆ ParallelForBody

using eve::thread::ParallelForBody = typedef std::function<void(int first, int last)>

Body of a parallel_for subrange.

参数
firstFirst index of the subrange (inclusive).
lastOne past the last index of the subrange (exclusive).

在文件 JobSystem.h22 行定义.

函数说明

◆ createJobSystem()

JobSystem * eve::thread::createJobSystem ( int  workerCount)

Create a JobSystem with the configured backend.

Backend switch point: the engine's scheduler is selected here. The default implementation schedules on top of the existing ThreadPool worker pool. A TBB backend only needs to implement the JobSystem/Job/TaskGroup interfaces and be returned from this factory.

This factory is the only place that knows which backend is compiled in; swapping the scheduler (custom vs TBB) is a change to JobSystem.cpp alone.

参数
workerCountWorker thread count; <= 0 means hardware concurrency.
返回
New JobSystem; the caller owns it and must delete it.

在文件 JobSystem.cpp14 行定义.

被这些函数引用 eve::thread::Thread::getJobSystem().

◆ Module_IMPL()

eve::thread::Module_IMPL ( Thread  ,
new   Thread() 
)