Loading...
Searching...
No Matches
WorkTaskGraph::BaseTask Class Referenceabstract

Base class for a parallel task that emulates tbb::task (deprecated in the oneTBB version upgrade.) This task abstracts a block of concurrent work
by exploiting knowledge of TBB's task-based work stealing scheduler architecture to provide memory and runtime optimizations. More...

#include <taskGraph.h>

Inherits WorkTaskGraph_DefaultImpl::BaseTask.

Inherited by VdfParallelExecutorEngineBase< Derived, DataManager >::_ComputeAllTask, VdfParallelExecutorEngineBase< Derived, DataManager >::_ComputeTask, VdfParallelExecutorEngineBase< Derived, DataManager >::_InputsTask, VdfParallelExecutorEngineBase< Derived, DataManager >::_KeepTask, VdfParallelExecutorEngineBase< Derived, DataManager >::_LeafTask< Callback >, and VdfParallelExecutorEngineBase< Derived, DataManager >::_TouchTask.

Public Member Functions

virtual BaseTaskexecute ()=0
 Derived classes override this method to implement a parallel unit of work.
 
void AddChildReference ()
 Increment the reference count of child tasks that must complete before this task can proceed.
 
int RemoveChildReference ()
 Decrement the reference count of child tasks that must complete before this task can proceed.
 
template<typename F , typename ... Args>
F * AllocateChild (Args &&... args)
 Construct a new subtask and increment the reference count of the calling task.
 

Protected Member Functions

void _RecycleAsContinuation ()
 Recycles this as a continuation task to mitigate the allocation overhead of the continuation task.
 

Detailed Description

Base class for a parallel task that emulates tbb::task (deprecated in the oneTBB version upgrade.) This task abstracts a block of concurrent work
by exploiting knowledge of TBB's task-based work stealing scheduler architecture to provide memory and runtime optimizations.

This is a callable object that can serve as an anchor to dynamically spawn additional children. It supports continuation passing, recycling of task resources, and scheduler bypass. All task graph tasks are heap-allocated and automatically released/reclaimed using reference counting.

Definition at line 106 of file taskGraph.h.

Member Function Documentation

◆ _RecycleAsContinuation()

void _RecycleAsContinuation ( )
inlineprotected

Recycles this as a continuation task to mitigate the allocation overhead of the continuation task.

Note
Note that the task graph performs safe continuation passing by default, i.e. it assumes an extra increment of the child reference count to handle the case when the continued task returns before a longer-lived child task. In this case, the extra reference prevents the continuation task from executing prematurely and orphaning its running child task.

Definition at line 147 of file taskGraph.h.

◆ AddChildReference()

void AddChildReference ( )
inline

Increment the reference count of child tasks that must complete before this task can proceed.


Definition at line 120 of file taskGraph.h.

◆ AllocateChild()

F * AllocateChild ( Args &&...  args)
inline

Construct a new subtask and increment the reference count of the calling task.


Definition at line 133 of file taskGraph.h.

◆ execute()

virtual BaseTask * execute ( )
pure virtual

Derived classes override this method to implement a parallel unit of work.


◆ RemoveChildReference()

int RemoveChildReference ( )
inline

Decrement the reference count of child tasks that must complete before this task can proceed.


Definition at line 126 of file taskGraph.h.


The documentation for this class was generated from the following file: