24Int_t mt_parallelHistoFill()
33 auto fillRandomHisto = [&](
int seed = 0) {
41 auto histogram = ts_h.Get();
43 histogram->Fill(rndm.Gaus(0, 1));
50 std::vector<std::thread> pool;
56 auto monitor = [&]() {
58 std::this_thread::sleep_for(std::chrono::duration<double, std::nano>(500));
59 auto h = ts_h.SnapshotMerge();
60 std::cout <<
"Entries for the snapshot " <<
h->GetEntries() << std::endl;
63 pool.emplace_back(monitor);
67 pool.emplace_back(fillRandomHisto, seed);
75 auto sumRandomHisto = ts_h.Merge();
77 std::cout <<
"Entries for the total sum " << sumRandomHisto->GetEntries() << std::endl;
80 sumRandomHisto->DrawClone();
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
A wrapper to make object instances thread private, lazily.
Random number generator class based on M.
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...