I am trying to parallelize operations over a large vector of objects in C++. I have written parallel programs in Java before, but I have just started using C++.
The current code uses an iterator over the vector. What would be the fastest way to parallelize this? My current thoughts are...
Using the .size() function and using a forloop through the vector. However, I am worried about the runtime of the .size() function, is it O(N) or O(1)? Also would forloops be slower than using an iterator?
Somehow splitting the vector, and create iterators for the new vectors in parallel? If so, what would be a good method of splitting the vector with a fast runtime?
Or is there some faster way to do this?