12#include "RConfigure.h"
18#define TBB_PREVIEW_ISOLATED_TASK_GROUP 1
19#include "tbb/task_group.h"
20#include "tbb/task_arena.h"
44 return (tbb::isolated_task_group *)p;
50namespace Experimental {
62 throw std::runtime_error(
"Implicit parallelism not enabled. Cannot instantiate a TTaskGroup.");
71 *
this = std::move(other);
78 other.fTaskContainer =
nullptr;
98 fTaskArenaW->Access().execute([&] { operation(); });
std::shared_ptr< ROOT::Internal::RTaskArenaWrapper > fTaskArenaW
void ExecuteInIsolation(const std::function< void(void)> &operation)
Run operation in the internal task arena to implement work isolation, i.e.
void Run(const std::function< void(void)> &closure)
Add to the group an item of work which will be ran asynchronously.
void Wait()
Wait until all submitted items of work are completed.
void Cancel()
Cancel all submitted tasks immediately.
TTaskGroup & operator=(TTaskGroup &&other)
std::shared_ptr< ROOT::Internal::RTaskArenaWrapper > GetGlobalTaskArena(unsigned maxConcurrency=0)
Factory function returning a shared pointer to the instance of the global RTaskArenaWrapper.
tbb::isolated_task_group * CastToTG(void *p)
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.