HDK
|
#include <UT_TaskArena.h>
Public Member Functions | |
UT_TaskArena (int max_concurrency=automatic, unsigned reserved_for_masters=1) | |
~UT_TaskArena () | |
void | initialize () |
int | maxConcurrency () const |
template<typename F > | |
void | execute (F &functor) |
template<typename F > | |
void | execute (const F &functor) |
Static Public Member Functions | |
template<typename F > | |
static void | enqueue (F &&f) |
template<typename M , typename F > | |
static void | lockedExecute (M &mutex, F &functor) |
template<typename M , typename F > | |
static void | lockedExecute (M &mutex, const F &functor) |
Static Public Attributes | |
static const int | automatic = -1 |
static SYS_AtomicInt32 | theArenaCount |
Simple wrapper for running code within a tbb::task_arena. For most usages, you want to do this if you're going to spawn tasks with a lock held.
Definition at line 33 of file UT_TaskArena.h.
Creates task_arena with certain concurrency limits
Sets up settings only, real construction is deferred till the first method invocation.
UT_TaskArena::~UT_TaskArena | ( | ) |
|
inlinestatic |
Enqueues a task into the arena to process a functor, and immediately returns. Does not require the calling thread to join the arena.
Definition at line 98 of file UT_TaskArena.h.
|
inline |
Joins the arena and executes a functor, then returns
If not possible to join, wraps the functor into a task, enqueues it and waits for task completion. Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread.
Definition at line 60 of file UT_TaskArena.h.
|
inline |
Joins the arena and executes a functor, then returns
If not possible to join, wraps the functor into a task, enqueues it and waits for task completion. Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread.
Definition at line 66 of file UT_TaskArena.h.
void UT_TaskArena::initialize | ( | ) |
Call this before using the arena if execute may be called from multiple threads.
|
inlinestatic |
Executes functor and by locking the given mutex and running it in a task_arena for exclusive work isolation.
Definition at line 77 of file UT_TaskArena.h.
|
inlinestatic |
Executes functor and by locking the given mutex and running it in a task_arena for exclusive work isolation.
Definition at line 86 of file UT_TaskArena.h.
int UT_TaskArena::maxConcurrency | ( | ) | const |
|
static |
Definition at line 36 of file UT_TaskArena.h.
|
static |
Definition at line 111 of file UT_TaskArena.h.