31#ifndef vtkMultiThreader_h
32#define vtkMultiThreader_h
34#include "vtkCommonCoreModule.h"
42#if defined(VTK_USE_PTHREADS) || defined(VTK_HP_PTHREADS)
70#ifdef VTK_USE_PTHREADS
71typedef void *(*vtkThreadFunctionType)(
void *);
78#ifdef VTK_USE_WIN32_THREADS
86#if !defined(VTK_USE_PTHREADS) && !defined(VTK_USE_WIN32_THREADS)
117#define ThreadInfoStruct vtkMultiThreader::ThreadInfo
134 vtkSetClampMacro( NumberOfThreads,
int, 1, VTK_MAX_THREADS );
236 int SpawnedThreadActiveFlag[VTK_MAX_THREADS];
243 void *MultipleData[VTK_MAX_THREADS];
a simple class to control print indentation
vtkMutexLock * ActiveFlagLock
A class for performing multithreaded execution.
static void SetGlobalDefaultNumberOfThreads(int val)
Set/Get the value which is used to initialize the NumberOfThreads in the constructor.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int GetGlobalMaximumNumberOfThreads()
int SpawnThread(vtkThreadFunctionType, void *data)
Create a new thread for the given function.
~vtkMultiThreader() override
static void SetGlobalMaximumNumberOfThreads(int val)
Set/Get the maximum number of threads to use when multithreading.
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...
void SingleMethodExecute()
Execute the SingleMethod (as define by SetSingleMethod) using this->NumberOfThreads threads.
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...
static int ThreadsEqual(vtkMultiThreaderIDType t1, vtkMultiThreaderIDType t2)
Check whether two thread identifiers refer to the same thread.
int IsThreadActive(int threadID)
Determine if a thread is still active.
void MultipleMethodExecute()
Execute the MultipleMethods (as define by calling SetMultipleMethod for each of the required this->Nu...
static vtkMultiThreader * New()
void TerminateThread(int thread_id)
Terminate the thread that was created with a SpawnThreadExecute()
static vtkMultiThreaderIDType GetCurrentThreadID()
Get the thread identifier of the calling thread.
static int GetGlobalDefaultNumberOfThreads()
virtual int GetNumberOfThreads()
mutual exclusion locking class
abstract base class for most VTK objects
int vtkMultiThreaderIDType
int vtkThreadProcessIDType
void(* vtkThreadFunctionType)(void *)