Open CASCADE Technology
7.1.0.beta
|
Simplifies code parallelization. More...
#include <OSD_Parallel.hxx>
Static Public Member Functions | |
public methods | |
static Standard_Integer | NbLogicalProcessors () |
Returns number of logical proccesrs. More... | |
template<typename InputIterator , typename Functor > | |
static void | ForEach (InputIterator theBegin, InputIterator theEnd, const Functor &theFunctor, const Standard_Boolean isForceSingleThreadExecution=Standard_False) |
Simple primitive for parallelization of "foreach" loops. More... | |
template<typename Functor > | |
static void | For (const Standard_Integer theBegin, const Standard_Integer theEnd, const Functor &theFunctor, const Standard_Boolean isForceSingleThreadExecution=Standard_False) |
Simple primitive for parallelization of "for" loops. More... | |
Simplifies code parallelization.
The Class provides an interface of parallel processing "for" and "foreach" loops. These 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.
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).
|
static |
Simple primitive for parallelization of "for" loops.
|
static |
Simple primitive for parallelization of "foreach" loops.
|
static |
Returns number of logical proccesrs.