载入中...
搜索中...
未找到
eve::thread::TaskGroup类 参考abstract

Fork/join group: fork() spawns scheduled children, wait() joins them. 更多...

#include <JobSystem.h>

Public 成员函数

virtual ~TaskGroup ()=default
 
virtual Jobfork (JobFunc body)=0
 Spawn a scheduled child job and add it to this group.
 
virtual Jobfork (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.h106 行定义.

构造及析构函数说明

◆ ~TaskGroup()

virtual eve::thread::TaskGroup::~TaskGroup ( )
virtualdefault

成员函数说明

◆ fork() [1/2]

virtual Job * eve::thread::TaskGroup::fork ( JobFunc  body)
pure virtual

Spawn a scheduled child job and add it to this group.

参数
bodyWork to run on a worker.
返回
Heap-allocated child job (caller owns it after wait()).

被这些函数引用 eve::graphics::vulkan::jobSystemPassExecutor().

◆ fork() [2/2]

virtual Job * eve::thread::TaskGroup::fork ( JobFunc  body,
JobFunc  onComplete 
)
pure virtual

Spawn a scheduled child job with a completion callback.

参数
bodyWork to run on a worker.
onCompleteCompletion callback (see Job::setCompletionCallback).
返回
Heap-allocated child job (caller owns it after wait()).

◆ getPendingCount()

virtual int eve::thread::TaskGroup::getPendingCount ( ) const
pure virtual

Number of forked children that have not finished yet.

◆ wait()

virtual void eve::thread::TaskGroup::wait ( )
pure virtual

Join every forked child: block until all of them finish. Safe from a worker thread.


该类的文档由以下文件生成: