5#include "tbb/task_scheduler_init.h"
12 std::weak_ptr<TPoolManager> &
GetWP()
14 static std::weak_ptr<TPoolManager> weak_sched;
27 nThreads = nThreads != 0 ? nThreads : tbb::task_scheduler_init::default_num_threads();
28 fSched ->initialize(nThreads);
51 if (
GetWP().expired()) {
52 std::shared_ptr<TPoolManager> shared(
new TPoolManager(nThreads));
54 return GetWP().lock();
56 return GetWP().lock();
TPoolManager(UInt_t nThreads=0)
Initializes the scheduler within ROOT.
tbb::task_scheduler_init * fSched
~TPoolManager()
Terminates the scheduler instantiated within ROOT.
static UInt_t GetPoolSize()
Returns the number of threads running when the scheduler has been instantiated within ROOT.
std::shared_ptr< TPoolManager > GetPoolManager(UInt_t nThreads=0)
Get a shared pointer to the manager.
std::weak_ptr< TPoolManager > & GetWP()
Namespace for new ROOT classes and functions.