13 #ifndef __UT_TASKARENA_H_INCLUDED__
14 #define __UT_TASKARENA_H_INCLUDED__
21 #include <tbb/task_arena.h>
36 static const int automatic = -1;
48 unsigned reserved_for_masters = 1);
60 void execute(F &functor)
62 internalExecute(&UT_TaskArena::callback<F>, &functor);
68 internalExecute(&UT_TaskArena::callbackConst<F>, &functor);
75 template <
typename M,
typename F>
84 template <
typename M,
typename F>
100 tbb::task_arena arena(tbb::task_arena::attach{});
101 arena.enqueue(std::forward<F>(
f));
108 int maxConcurrency()
const;
115 template <
typename F>
116 static void callback(
void *
data)
118 (*
reinterpret_cast<F *
>(
data))();
120 template <
typename F>
121 static void callbackConst(
const void *
data)
123 (*
reinterpret_cast<const F *
>(
data))();
126 void internalExecute(
void (*callback)(
void *),
void *
data);
127 void internalExecute(
void (*callback)(
const void *),
const void *
data);
130 static const size_t SIZEOF_ARENA = 40;
131 uint8 myArena[SIZEOF_ARENA];
134 #endif // __UT_TASKARENA_H_INCLUDED__
static void lockedExecute(M &mutex, const F &functor)
static void enqueue(F &&f)
static void lockedExecute(M &mutex, F &functor)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
static SYS_AtomicInt32 theArenaCount
void execute(const F &functor)