Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThreadPool / getChannel / newChannel. 更多...
#include <Thread.h>
Public 成员函数 | |
| Module_REG (Thread) | |
| Thread () | |
| ~Thread () override | |
| int | getHardwareConcurrency () const |
| Hardware concurrency hint (at least 1). | |
| ThreadPool * | getPool () |
| Shared default pool (created lazily with hardwareConcurrency workers). | |
| ThreadPool * | newThreadPool (int workerCount=0) |
| Create an independent pool. Caller owns it (delete when done). | |
| JobSystem * | getJobSystem () |
| Shared engine-wide JobSystem (created lazily with hardware concurrency workers). Use it for dependency graphs, parallel_for and frame-scoped jobs; the pool below remains for simple async work. | |
| Channel * | getChannel (std::string name) |
| Named shared channel (love2d-style). Same name → same Channel instance for the lifetime of the module. | |
| Channel * | newChannel () |
| Anonymous channel (not registered in the name map). Caller owns it. | |
| void | postMain (std::string name, std::string data="") |
| Thread-safe post onto the Event module queue (any thread). Main loop: event.pump is unrelated; just event.poll / pollData. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThreadPool / getChannel / newChannel.
构造及析构函数说明
◆ Thread()
|
default |
◆ ~Thread()
|
override |
在文件 Thread.cpp 第 19 行定义.
成员函数说明
◆ getChannel()
| Channel * eve::thread::Thread::getChannel | ( | std::string | name | ) |
Named shared channel (love2d-style). Same name → same Channel instance for the lifetime of the module.
在文件 Thread.cpp 第 51 行定义.
引用了 name.
◆ getHardwareConcurrency()
| int eve::thread::Thread::getHardwareConcurrency | ( | ) | const |
Hardware concurrency hint (at least 1).
在文件 Thread.cpp 第 26 行定义.
引用了 n.
被这些函数引用 getJobSystem() , 以及 getPool().
◆ getJobSystem()
| JobSystem * eve::thread::Thread::getJobSystem | ( | ) |
Shared engine-wide JobSystem (created lazily with hardware concurrency workers). Use it for dependency graphs, parallel_for and frame-scoped jobs; the pool below remains for simple async work.
在文件 Thread.cpp 第 44 行定义.
引用了 eve::thread::createJobSystem() , 以及 getHardwareConcurrency().
◆ getPool()
| ThreadPool * eve::thread::Thread::getPool | ( | ) |
Shared default pool (created lazily with hardwareConcurrency workers).
在文件 Thread.cpp 第 31 行定义.
◆ Module_REG()
| eve::thread::Thread::Module_REG | ( | Thread | ) |
◆ newChannel()
| Channel * eve::thread::Thread::newChannel | ( | ) |
Anonymous channel (not registered in the name map). Caller owns it.
在文件 Thread.cpp 第 64 行定义.
◆ newThreadPool()
| ThreadPool * eve::thread::Thread::newThreadPool | ( | int | workerCount = 0 | ) |
Create an independent pool. Caller owns it (delete when done).
在文件 Thread.cpp 第 38 行定义.
◆ postMain()
| void eve::thread::Thread::postMain | ( | std::string | name, |
| std::string | data = "" |
||
| ) |
Thread-safe post onto the Event module queue (any thread). Main loop: event.pump is unrelated; just event.poll / pollData.
在文件 Thread.cpp 第 66 行定义.
引用了 data, name , 以及 eve::cap::query().
该类的文档由以下文件生成:
- src/modules/thread/Thread.h
- src/modules/thread/Thread.cpp
Public 成员函数 继承自