3 ms·
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
by apaprocki 15y ago
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 http://openmp.org/mp-documents/OpenMP3.1-CCard.pdf