Simple primitives to parallelize loops type "for" and "foreach" were implemented. The primitives encapsulates complete logic for creating and managing parallel context of loops. Moreover the primitives may be a wrapper for some primitives from 3rd-party library - TBB.
To use it is necessary to implement TBB like interface which is based on functors. For example:
Class Functor
{
public:
void operator() ([proccesing instance]) const
{
//...
}
};
In the body of the operator () should be implemented thread-safe logic of computations that can be performed in parallel context. If parallelized loop iterates on the collections with direct access by index (such as Vector, Array), it is more efficient to use the primitive ParallelFor (because it has no critical section).
All parts of OCC code which are using tbb were changed on new primitives.
0024826: Wrapping of parallelisation algorithms
Small fix.