![]() |
|
Instances of this class are used to synchronize dynamic, acyclic task graphs, allowing tasks to claim dependents for processing. More...
#include <parallelTaskSync.h>
Public Types | |
| enum class | State { Done , Wait , Claimed } |
| The different states a task can be in. More... | |
Public Member Functions | |
| VdfParallelTaskSync (const VdfParallelTaskSync &)=delete | |
| Noncopyable. | |
| VdfParallelTaskSync & | operator= (const VdfParallelTaskSync &)=delete |
| VdfParallelTaskSync (WorkTaskGraph *taskGraph) | |
| Constructor. | |
| VDF_API void | Reset (const size_t num) |
| Resets the state of all tasks in the graph. | |
| State | Claim (const size_t idx, WorkTaskGraph::BaseTask *successor) |
Claims the task idx for processing, and returns the new task state. | |
| void | MarkDone (const size_t idx) |
Mark the task idx as done. | |
Instances of this class are used to synchronize dynamic, acyclic task graphs, allowing tasks to claim dependents for processing.
Methods on this class are thread-safe unless specifically called out to not be thread-safe.
Definition at line 34 of file parallelTaskSync.h.
|
strong |
The different states a task can be in.
Definition at line 61 of file parallelTaskSync.h.
|
delete |
Noncopyable.
|
inline |
Constructor.
Definition at line 44 of file parallelTaskSync.h.
|
inline |
Claims the task idx for processing, and returns the new task state.
This method will automatically increment the reference count of the successor, if the task has already been claimed, and will cause the reference count of successor to be automatically decremented as soon as the task completes.
Definition at line 116 of file parallelTaskSync.h.
|
inline |
Mark the task idx as done.
This method will notify any tasks depending on idx about the completion of idx.
Definition at line 141 of file parallelTaskSync.h.
| VDF_API void Reset | ( | const size_t | num | ) |
Resets the state of all tasks in the graph.
Ensures that num entries are available for use.
It is not thread-safe to call this method on the same instance from multiple threads.