I am wondering how I can parallelise for loop below in a secure way. I found some possible solution like this . However I am limited to use OpenMP version 2.0 and Boost version 1.59.
algorithm explanation:
It iterates over all of my triangles which lie within the bounding box, then it checks possibility of the intersection (with a unique triangle) in _considerTriangle function. Finally in the _considerTriangle, if a triangle is intersected it inserts triangle to a set container intersectedTri.
//Iterating through every triangle
std::set<Triangle> intersectedTri;
for(IntersectedTrianglesIterator it=tree.Begin_IteratorByBoundingBox(bbox_min,bbox_max);it!=tree.End_IteratorByBoundingBox(bbox_min,bbox_max);++it)
_ConsiderTriangle(it->GetTriangle());
I am wonderying how I can paralllise it safely.