KyGlue::TbbParallelForInterface Class Reference

KyGlue::TbbParallelForInterface Class Reference

#include <tbbparallelforinterface.h>

Class Description

This implementation of Kaim::IParallelForInterface uses the open-source Threaded Building Blocks (TBB) libraries from Intel to take advantage of multi-core CPU.

In debug, TbbParallelForInterface is single-threaded and does not use TBB at all. This is because TBB is very slow in debug and tbb.dll depends on the debug version of msvcrt.dll that cannot be redistributed. You can use this class directly, or use its source code as a model for developing your own implementations of Kaim::IParallelForInterface to support third-party parallel processing systems.

Inherits Kaim::IParallelForInterface.

Public Member Functions

virtual KyResult Init ()
 This method is expected to perform whatever steps are needed to initialize the parallelization mechanism. More...
 
virtual KyResult Terminate ()
 This method is expected to perform whatever steps are needed to shut down the parallelization mechanism. More...
 
virtual KyResult ParallelFor (void **elements, KyUInt32 elementsCount, Kaim::IParallelElementFunctor *elementFunctor)
 This is the main method of the IParallelForInterface: it is called by Autodesk Navigation to manage the parallel execution of an array of computational jobs. More...
 

Member Function Documentation

KyResult KyGlue::TbbParallelForInterface::Init ( )
virtual

This method is expected to perform whatever steps are needed to initialize the parallelization mechanism.

Called once by the Generator at the beginning of the data generation process.

Implements Kaim::IParallelForInterface.

KyResult KyGlue::TbbParallelForInterface::ParallelFor ( void **  elements,
KyUInt32  elementsCount,
Kaim::IParallelElementFunctor functor 
)
virtual

This is the main method of the IParallelForInterface: it is called by Autodesk Navigation to manage the parallel execution of an array of computational jobs.

An implementation of this method should call the IParallelElementFunctor::Do() method for each element in the elements array.

Parameters
elementsAn array of void pointers, each of which points to a computational job that needs to be carried out.
elementsCountThe number of elements in the elements array.
functorA pointer to the object that should be responsible for actually treating each element in the elements array.

Implements Kaim::IParallelForInterface.

KyResult KyGlue::TbbParallelForInterface::Terminate ( )
virtual

This method is expected to perform whatever steps are needed to shut down the parallelization mechanism.

Called once by the Generator at the end of the data generation process.

Implements Kaim::IParallelForInterface.


The documentation for this class was generated from the following files: