#include <iostream>
#include <future>
#include <random>
double wasteCPUTime(std::mt19937 &gen)
{
return std::generate_canonical<double, 100>(gen) + std::generate_canonical<double, 100>(gen) +
std::generate_canonical<double, 100>(gen) + std::generate_canonical<double, 100>(gen) +
std::generate_canonical<double, 100>(gen);
}
void theTask(Filler_t filler)
{
std::mt19937 gen;
for (int i = 0; i < 3000000; ++i)
filler.
Fill({wasteCPUTime(gen), wasteCPUTime(gen)});
}
{
std::array<std::thread, 8> threads;
for (auto &thr: threads) {
thr = std::thread(theTask, fillMgr.MakeFiller());
}
for (auto &thr: threads)
thr.join();
}
void concurrentfill()
{
concurrentHistFill(hist);
}
void Fill(const CoordArray_t &x, Weight_t weight=1.)
Manages the synchronization of calls to FillN().
Buffers a thread's Fill calls and submits them to the RHistConcurrentFillManager.
Histogram class for histograms with DIMENSIONS dimensions, where each bin count is stored by a value ...
int64_t GetEntries() const noexcept
Get the number of entries this histogram was filled with.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...