#include <tbbparallelforinterface.h>
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... | |
|
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.
|
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.
elements | An array of void pointers, each of which points to a computational job that needs to be carried out. |
elementsCount | The number of elements in the elements array. |
functor | A pointer to the object that should be responsible for actually treating each element in the elements array. |
Implements Kaim::IParallelForInterface.
|
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.