14 const UInt_t nNumbers = 20000000U;
17 const UInt_t nThreads = 4U;
19 Int_t mtbb001_fillHistos()
21 ROOT::EnableThreadSafety();
23 auto workItem = [](UInt_t workerID) {
25 TRandom3 workerRndm(workerID);
26 TFile f(Form(
"myFile_mtbb001_%u.root", workerID),
"RECREATE");
27 TH1F h(Form(
"myHisto_%u", workerID),
"The Histogram", 64, -4, 4);
28 for (UInt_t i = 0; i < nNumbers; ++i) {
29 h.Fill(workerRndm.Gaus());
36 ROOT::TThreadExecutor pool(nThreads);
39 pool.Map(workItem, ROOT::TSeqI(nThreads));