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 wrapper to make object instances thread private, lazily.
Random number generator class based on M.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...