Re:C++11 multithreading tutorial
by apaprocki on Friday December 16, 2011 @12:46PM
(#3361393)
This kind of threaded for-loop processing is precisely what OpenMP is designed to take care of without having to control threads directly from your code. Making sure your code is thread-safe is good practice anyway, and running the for loop in parallel could be as easy as using:
#pragma omp for ...
Disclaimer: I haven't found that OpenMP is too useful outside of pure computation, but it is worth mentioning if all you want to do is run loops in parallel.
Current spec (pdf): http://openmp.org/mp-documents/OpenMP3.1-CCard.pdf