A Task payload that embeds TFunc and TArgs into the Task's data. It makes it easy to construct a Task from a lambda or a function plus arguments similar to std::thread.
More...
#include <Task.h>
Inherited by gts::CStyleTask, gts::EmptyTask, gts::LambdaTaskWrapper< TFunc, TArgs >, gts::MicroScheduler_Task, gts_examples::BadParallelFor::ForTask< TFunc >, gts_examples::BasicTask, gts_examples::GridSumTask, gts_examples::ParallelFibContinuationTask, gts_examples::ParallelFibContinuationTask3, gts_examples::ParallelFibContinuationTask4, gts_examples::ParallelFibTask1, gts_examples::ParallelFibTask2, gts_examples::ParallelFibTask3, and gts_examples::ParallelFibTask4.
|
class | MicroScheduler |
|
class | LocalScheduler |
|
class | Worker |
|
A Task payload that embeds TFunc and TArgs into the Task's data. It makes it easy to construct a Task from a lambda or a function plus arguments similar to std::thread.
Derivative of TBB Task. https://github.com/intel/tbb
◆ addChildTaskWithoutRef()
void Task::addChildTaskWithoutRef |
( |
Task * |
pChild | ) |
|
Adds pChild as a child of this task. It DOES NOT increment this task's ref count so the caller must have manually increment the reference count before calling this function. Failing to do so is undefined behavior. pChild cannot already have a parent.
◆ addChildTaskWithRef()
Adds pChild as a child of this task AND increments this task's ref count. pChild cannot already have a parent.
◆ addRef()
int32_t Task::addRef |
( |
int32_t |
count = 1 , |
|
|
gts::memory_order |
order = gts::memory_order::seq_cst |
|
) |
| |
Adds a reference to the task.
◆ getAffinity()
uint32_t Task::getAffinity |
( |
| ) |
const |
- Returns
- The current Worker affinity.
◆ isStolen()
bool Task::isStolen |
( |
| ) |
const |
◆ name()
const char * Task::name |
( |
| ) |
const |
- Returns
- The name of the task.
◆ parent()
- Returns
- This task's parent. nullptr is no parent is set.
◆ recycle()
Marks the task to be reused after it has finished executing. Makes the Task look like it was just allocated. If the task is not added into a task graph with addChild* or setContinuation or returned as a bypass Task, it will be spawned.
◆ refCount()
- Returns
- The current reference count.
◆ removeRef()
int32_t Task::removeRef |
( |
int32_t |
count = 1 , |
|
|
gts::memory_order |
order = gts::memory_order::seq_cst |
|
) |
| |
Removes a reference from the task.
◆ setAffinity()
void Task::setAffinity |
( |
uint32_t |
workerIdx | ) |
|
Force the task to run on a specific Worker thread.
◆ setContinuationTask()
void Task::setContinuationTask |
( |
Task * |
pContinuation | ) |
|
Sets pContinuation as a continuation of this task. pContinuation cannot already have a parent.
◆ setName()
void Task::setName |
( |
const char * |
name | ) |
|
Sets the name of the task.
◆ setRef()
void Task::setRef |
( |
int32_t |
count, |
|
|
gts::memory_order |
order = gts::memory_order::seq_cst |
|
) |
| |
◆ spawnAndWaitForAll()
void gts::Task::spawnAndWaitForAll |
( |
Task * |
pChild | ) |
|
Executes pChild immediately and then waits for all this Task's children to complete before continuing. While waiting, this task will execute other available work.
◆ waitForAll()
void gts::Task::waitForAll |
( |
| ) |
|
Waits for all this Task's children to complete before continuing. While waiting, this task will execute other available work.