#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);
}
- Date
- 2015-07-09
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Axel Naumann axel@.nosp@m.cern.nosp@m..ch
Definition in file concurrentfill.cxx.