OfxMultiThreadSuiteV1::multiThread
— Function to spawn SMP threads
#include "ofxMultiThread.h"
OfxStatus
(*multiThread)
(
|
OfxThreadFunctionV1 func , |
unsigned int nThreads , | |
void *
customArg
)
;
|
This function will spawn nThreads separate threads of computation (typically one per CPU) to allow something to perform symmetric multi processing. Each thread will call 'func' passing in the index of the thread and the number of threads actually launched.
multiThread will not return until all the spawned threads have returned. It is up to the host how it waits for all the threads to return (busy wait, blocking, whatever).
nThreads can be more than the value returned by multiThreadNumCPUs, however the threads will be limitted to the number of CPUs returned by multiThreadNumCPUs.
This function cannot be called recursively.
kOfxStatOK
, the function func has executed and returned sucessfully
kOfxStatFailed
, the threading function failed to launch
kOfxStatErrExists
, failed in an attempt to call multiThread recursively,