Discussion on the OpenMP specification run by the OpenMP ARB. OpenMP and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board in the United States and other countries. All rights reserved.
Provided z is a random access iterator, you can use a #pragma omp parallel for directive for this example. However, this will not create a separate thread for each iteration: it will create a fixed number of threads and share out the iterations amongst these threads.