 |
VTK
9.1.0
|
Go to the documentation of this file.
25 #ifndef vtkMultiThreader_h
26 #define vtkMultiThreader_h
28 #include "vtkCommonCoreModule.h"
30 #include "vtkThreads.h"
34 #if defined(VTK_USE_PTHREADS)
36 #include <sys/types.h>
52 #ifdef VTK_USE_PTHREADS
53 typedef void* (*vtkThreadFunctionType)(
void*);
60 #ifdef VTK_USE_WIN32_THREADS
68 #if !defined(VTK_USE_PTHREADS) && !defined(VTK_USE_WIN32_THREADS)
112 vtkSetClampMacro(NumberOfThreads,
int, 1, VTK_MAX_THREADS);
220 int SpawnedThreadActiveFlag[VTK_MAX_THREADS];
221 std::mutex* SpawnedThreadActiveFlagLock[VTK_MAX_THREADS];
227 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()
Set/Get the maximum number of threads to use when multithreading.
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.
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,...
void TerminateThread(int threadId)
Terminate the thread that was created with a SpawnThreadExecute()
A class for performing multithreaded execution.
static int GetGlobalDefaultNumberOfThreads()
Set/Get the value which is used to initialize the NumberOfThreads in the constructor.
void SingleMethodExecute()
Execute the SingleMethod (as define by SetSingleMethod) using this->NumberOfThreads threads.
a simple class to control print indentation
~vtkMultiThreader() override
std::mutex * ActiveFlagLock
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()
Get/Set the number of threads to create.
static int GetGlobalStaticMaximumNumberOfThreads()
Set/Get the maximum number of threads VTK was allocated to support.
vtkTypeBool IsThreadActive(int threadId)
Determine if a thread is still active.
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...
int SpawnThread(vtkThreadFunctionType, void *data)
Create a new thread for the given function.