//! Returns number of logical proccesrs.
Standard_EXPORT static Standard_Integer NbLogicalProcessors();
- //! Simple primitive for parallelization of "foreach" loops.
+ //! Simple primitive for parallelization of "foreach" loops, e.g.:
+ //! @code
+ //! for (std::iterator anIter = theBegin; anIter != theEnd; ++anIter) {}
+ //! @endcode
+ //! @param theBegin the first index (incusive)
+ //! @param theEnd the last index (exclusive)
+ //! @param theFunctor functor providing an interface "void operator(InputIterator theIter){}" performing task for specified iterator position
+ //! @param isForceSingleThreadExecution if true, then no threads will be created
template <typename InputIterator, typename Functor>
static void ForEach( InputIterator theBegin,
InputIterator theEnd,
const Standard_Boolean isForceSingleThreadExecution
= Standard_False );
- //! Simple primitive for parallelization of "for" loops.
+ //! Simple primitive for parallelization of "for" loops, e.g.:
+ //! @code
+ //! for (int anIter = theBegin; anIter < theEnd; ++anIter) {}
+ //! @endcode
+ //! @param theBegin the first index (incusive)
+ //! @param theEnd the last index (exclusive)
+ //! @param theFunctor functor providing an interface "void operator(int theIndex){}" performing task for specified index
+ //! @param isForceSingleThreadExecution if true, then no threads will be created
template <typename Functor>
static void For( const Standard_Integer theBegin,
const Standard_Integer theEnd,
{
if ( isForceSingleThreadExecution )
{
- for ( InputIterator it(theBegin); it != theEnd; it++ )
+ for ( InputIterator it(theBegin); it != theEnd; ++it )
theFunctor(*it);
return;
}
StdPrs_WFShape_IsoFunctor anIsoFunctor (*aUPolylinesPtr, *aVPolylinesPtr, aFaces, theDrawer, aShapeDeflection);
- OSD_Parallel::For (0, aNbFaces - 1, anIsoFunctor, aNbFaces < 2);
+ OSD_Parallel::For (0, aNbFaces, anIsoFunctor, aNbFaces < 2);
}
}