|
C++ API Reference
|
Methods for creating and managing a thread pool. More...
#include <MThreadPool.h>
Static Public Member Functions | |
| static MStatus | init () |
| Initialize thread pool creation. More... | |
| static MStatus | newParallelRegion (MThreadCallbackFunc func, void *data) |
| Creates a new parallel region. More... | |
| static MStatus | createTask (MThreadFunc func, void *data, MThreadRootTask *root) |
| Add a single task to the parallel region. More... | |
| static MStatus | executeAndJoin (MThreadRootTask *root) |
| Run all tasks in the present parallel region to completion. More... | |
| static void | release () |
| Release decreases the reference count on the thread pool. More... | |
| static const char * | className () |
| Returns the name of this class. More... | |
Methods for creating and managing a thread pool.
MThreadPool class. The thread pool is created with a number of threads equal to one less than the number of logical processors.
|
static |
Initialize thread pool creation.
No threads are created by this call.
|
static |
Creates a new parallel region.
All tasks created by createTask() will be added to this region. init() must be called to create the thread pool before calling this function.
| [in] | func | pointer to function to be executed by threads |
| [in] | data | data for function |
|
static |
Add a single task to the parallel region.
The parallel region must already have been created by calling newParallelRegion.
| [in] | func | pointer to function to be executed by threads |
| [in] | data | data for function |
| [in] | root | root task |
|
static |
Run all tasks in the present parallel region to completion.
This function must be called from within a function invoked by the method newParallelRegion.
| [in] | root | task to execute |
|
static |
Release decreases the reference count on the thread pool.
When the reference count reaches zero the thread pool is deleted.
|
static |
Returns the name of this class.