#include <task_group.h>
Public Member Functions | |
AZ_CLASS_ALLOCATOR (structured_task_group, ThreadPoolAllocator) | |
structured_task_group () | |
structured_task_group (JobContext *parentContext) | |
template<typename F > | |
void | run (const F &f) |
template<typename F > | |
void | run_and_wait (const F &f) |
void | wait () |
void | cancel () |
bool | is_canceling () const |
This is the new pseudo-standard interface for running jobs, can be found in VS2010 and Intel's Threading Building Blocks. It is reasonably efficient, but it uses child jobs to implement the wait() function, which are usually less efficient than explicit dependencies, and can have stack depth issues.
|
inlineexplicit |
This default constructor obtains the parent JobContext from the global context. The parent context can be also specified explicitly.
|
inline |
Differs from the 'standard' in that it requires a context to be specified, we do not have a global default context for jobs.
|
inline |
Cancels all the jobs which were started on this task_group.
|
inline |
Checks if this task_group has been cancelled.
|
inline |
Starts running the specified function asynchronously as a job. The function f should have void return type and take no parameters.
|
inline |
Starts running the specified function asynchronously as a job, and then waits until all the jobs on this structured_task_group have completed. The function f should have void return type and take no parameters. If this is called from within a job then the function will be executed immediately instead of scheduling it.
|
inline |
Waits until all the jobs started on this task_group have completed. Note that this does not automatically include jobs which were launched by other jobs, unless the job which spawned them also waited for them to complete.