Go to the documentation of this file.
31 #ifndef vtkMultiThreader_h
32 #define vtkMultiThreader_h
34 #include "vtkCommonCoreModule.h"
37 #if defined(VTK_USE_PTHREADS)
39 #include <sys/types.h>
57 #ifdef VTK_USE_PTHREADS
58 typedef void *(*vtkThreadFunctionType)(
void *);
65 #ifdef VTK_USE_WIN32_THREADS
73 #if !defined(VTK_USE_PTHREADS) && !defined(VTK_USE_WIN32_THREADS)
119 vtkSetClampMacro( NumberOfThreads,
int, 1, VTK_MAX_THREADS );
221 int SpawnedThreadActiveFlag[VTK_MAX_THREADS];
228 void *MultipleData[VTK_MAX_THREADS];
void MultipleMethodExecute()
Execute the MultipleMethods (as define by calling SetMultipleMethod for each of the required this->Nu...
void SetSingleMethod(vtkThreadFunctionType, void *data)
Set the SingleMethod to f() and the UserData field of the ThreadInfo that is passed to it will be dat...
int vtkMultiThreaderIDType
static int GetGlobalMaximumNumberOfThreads()
static vtkTypeBool ThreadsEqual(vtkMultiThreaderIDType t1, vtkMultiThreaderIDType t2)
Check whether two thread identifiers refer to the same thread.
static void SetGlobalDefaultNumberOfThreads(int val)
Set/Get the value which is used to initialize the NumberOfThreads in the constructor.
mutual exclusion locking class
abstract base class for most VTK objects
vtkThreadFunctionType SingleMethod
int vtkThreadProcessIDType
This is the structure that is passed to the thread that is created from the SingleMethodExecute,...
A class for performing multithreaded execution.
static int GetGlobalDefaultNumberOfThreads()
void SingleMethodExecute()
Execute the SingleMethod (as define by SetSingleMethod) using this->NumberOfThreads threads.
a simple class to control print indentation
~vtkMultiThreader() override
static void SetGlobalMaximumNumberOfThreads(int val)
Set/Get the maximum number of threads to use when multithreading.
static vtkMultiThreaderIDType GetCurrentThreadID()
Get the thread identifier of the calling thread.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMultiThreader * New()
virtual int GetNumberOfThreads()
vtkMutexLock * ActiveFlagLock
void(* vtkThreadFunctionType)(void *)
void SetMultipleMethod(int index, vtkThreadFunctionType, void *data)
Set the MultipleMethod at the given index to f() and the UserData field of the ThreadInfo that is pas...
vtkTypeBool IsThreadActive(int threadID)
Determine if a thread is still active.
void TerminateThread(int thread_id)
Terminate the thread that was created with a SpawnThreadExecute()
int SpawnThread(vtkThreadFunctionType, void *data)
Create a new thread for the given function.