21Int_t mt201_parallelHistoFill()
30 auto fillRandomHisto = [&](
int seed = 0) {
38 auto histogram = ts_h.Get();
40 histogram->Fill(rndm.Gaus(0, 1));
47 std::vector<std::thread> pool;
53 auto monitor = [&]() {
55 std::this_thread::sleep_for(std::chrono::duration<double, std::nano>(500));
56 auto h = ts_h.SnapshotMerge();
57 std::cout <<
"Entries for the snapshot " <<
h->GetEntries() << std::endl;
60 pool.emplace_back(monitor);
64 pool.emplace_back(fillRandomHisto, seed);
72 auto sumRandomHisto = ts_h.Merge();
74 std::cout <<
"Entries for the total sum " << sumRandomHisto->GetEntries() << std::endl;
77 sumRandomHisto->DrawClone();
A pseudo container class which is a generator of indices.
A wrapper to make object instances thread private, lazily.
Random number generator class based on M.
void EnableThreadSafety()
Enables the global mutex to make ROOT thread safe/aware.