Alternatively, a rather portable (*) and relatively non-intrusive library, well supported on g ++ and (with the old version) on MSVC, OpenMP .
This is not standard C ++, but OpenMP itself is the standard. This makes it easy to loop through:
#pragma omp parallel for
for (int i=0; i!=x; ++i) {
}
He also has the ability to complete tasks and time (and much more), but, in my opinion, this kingโs discipline is above parallel for parallelism.
(*) If you are left with pragmas, this is not entirely impossible.
source
share