Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThreadPool / getChannel / newChannel. 更多...
#include <Thread.h>
Public 成员函数 | |
| Module_REG (Thread) | |
| Thread () | |
| Thread. | |
| ~Thread () override | |
| Thread. | |
| int | getHardwareConcurrency () const |
| Hardware concurrency hint (at least 1). | |
| ThreadPool * | getPool () |
| Shared default pool (created lazily with hardwareConcurrency workers). @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed. | |
| ThreadPool * | newThreadPool (int workerCount=0) |
| Create an independent pool. @ownership Owned; caller must delete when done. @lifetime Valid until the caller deletes it. | |
| 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. @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed. | |
| Channel * | getChannel (std::string channelName) |
| Named shared channel (love2d-style). Same name → same Channel instance for the lifetime of the module. @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed. Calls that create or query other named channels do not invalidate the returned pointer. | |
| Channel * | newChannel () |
| Anonymous channel (not registered in the name map). @ownership Owned; caller must delete when done. @lifetime Valid until the caller deletes it. | |
| 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 event.poll / pollData. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
Thread module: default pool, named channels, pool factory. Script: eve.Thread() → getPool / newThreadPool / getChannel / newChannel.
构造及析构函数说明
◆ Thread()
| eve::thread::Thread::Thread | ( | ) |
在文件 Thread.cpp 第 49 行定义.
◆ ~Thread()
|
override |
在文件 Thread.cpp 第 54 行定义.
成员函数说明
◆ getChannel()
| Channel * eve::thread::Thread::getChannel | ( | std::string | channelName | ) |
Named shared channel (love2d-style). Same name → same Channel instance for the lifetime of the module. @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed. Calls that create or query other named channels do not invalidate the returned pointer.
在文件 Thread.cpp 第 88 行定义.
◆ getHardwareConcurrency()
| int eve::thread::Thread::getHardwareConcurrency | ( | ) | const |
Hardware concurrency hint (at least 1).
在文件 Thread.cpp 第 63 行定义.
引用了 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. @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed.
在文件 Thread.cpp 第 81 行定义.
引用了 eve::thread::createJobSystem() , 以及 getHardwareConcurrency().
◆ getPool()
| ThreadPool * eve::thread::Thread::getPool | ( | ) |
Shared default pool (created lazily with hardwareConcurrency workers). @ownership Borrowed from this Thread module; callers must not delete it. @lifetime Valid until this Thread module is destroyed.
在文件 Thread.cpp 第 68 行定义.
◆ Module_REG()
| eve::thread::Thread::Module_REG | ( | Thread | ) |
◆ newChannel()
| Channel * eve::thread::Thread::newChannel | ( | ) |
Anonymous channel (not registered in the name map). @ownership Owned; caller must delete when done. @lifetime Valid until the caller deletes it.
在文件 Thread.cpp 第 101 行定义.
◆ newThreadPool()
| ThreadPool * eve::thread::Thread::newThreadPool | ( | int | workerCount = 0 | ) |
Create an independent pool. @ownership Owned; caller must delete when done. @lifetime Valid until the caller deletes it.
在文件 Thread.cpp 第 75 行定义.
◆ postMain()
| void eve::thread::Thread::postMain | ( | std::string | eventName, |
| 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 第 103 行定义.
该类的文档由以下文件生成:
- src/modules/thread/Thread.h
- src/modules/thread/Thread.cpp
Public 成员函数 继承自