OpenMP and Multithreading

Tutorials

 * From LLNL

simple parallelization

 * brute force loop parallelization with direct access to elements using [] (for instance with int[], vectors, valarray...)


 * with stl iterators on containers, provided foo does independent processes (not efficient):

or better you can use the reduction sentence for a list of several variables (cannot be arrays or structured data type)
 * calculating a sum

Python
one may preferably use multiprocessing