Inherits task.
Public Member Functions | |
OpTask (DD::Image::Op *op, int depth) | |
void | addSuccessor (OpTask *task) |
std::vector< OpTask * > & | getSuccessors () |
tbb::task * | execute () |
std::string | name () const |
DD::Image::Op * | op () const |
std::vector< OpTask * > | inputs () const |
void | setParentOp (DD::Image::Op *op) |
DD::Image::Op * | parentOp () const |
void | dump () const |
Defines a TBB task for executing a single Nuke Op. The op may be the root of a sub-tree of ops, with the leaves being either ops without inputs or ops whose inputs have been cached by earlier tasks.
Every TBB task stores a reference count identifying the number of dependent tasks that need to have been executed before it can run. We initially set the reference count for OpTasks to be equal to the op's number of inputs. When a task completes the reference count for each of its "successors" (tasks which depend on its output) is decremented. Any successor tasks whose reference count reaches 0 have all the input data they need to proceed and will be added to a list of tasks that will then be executed in parallel. This process continues until the entire task graph has been executed.
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |