载入中...
搜索中...
未找到
eve::thread::TaskGroup类 参考abstract
Fork/join group: fork() spawns scheduled children, wait() joins them. 更多...
#include <JobSystem.h>
Public 成员函数 | |
| virtual | ~TaskGroup ()=default |
| virtual Job * | fork (JobFunc body)=0 |
| Spawn a scheduled child job and add it to this group. | |
| virtual Job * | fork (JobFunc body, JobFunc onComplete)=0 |
| Spawn a scheduled child job with a completion callback. | |
| virtual void | wait ()=0 |
| Join every forked child: block until all of them finish. Safe from a worker thread. | |
| virtual int | getPendingCount () const =0 |
| Number of forked children that have not finished yet. | |
详细描述
Fork/join group: fork() spawns scheduled children, wait() joins them.
wait() is safe from a worker thread (the worker helps execute ready jobs), which makes task_group the natural building block for nested parallelism inside another job. The group may be reused after wait(): children are cleared once joined.
在文件 JobSystem.h 第 106 行定义.
构造及析构函数说明
◆ ~TaskGroup()
|
virtualdefault |
成员函数说明
◆ fork() [1/2]
Spawn a scheduled child job and add it to this group.
- 参数
-
body Work to run on a worker.
- 返回
- Heap-allocated child job (caller owns it after wait()).
◆ fork() [2/2]
Spawn a scheduled child job with a completion callback.
- 参数
-
body Work to run on a worker. onComplete Completion callback (see Job::setCompletionCallback).
- 返回
- Heap-allocated child job (caller owns it after wait()).
◆ getPendingCount()
|
pure virtual |
Number of forked children that have not finished yet.
◆ wait()
|
pure virtual |
Join every forked child: block until all of them finish. Safe from a worker thread.
该类的文档由以下文件生成:
- src/modules/thread/JobSystem.h