28 #ifndef itkMultiThreader_h 29 #define itkMultiThreader_h 55 class ITKCommon_EXPORT MultiThreader :
public Object
59 typedef MultiThreader Self;
60 typedef Object Superclass;
61 typedef SmartPointer<Self> Pointer;
62 typedef SmartPointer<const Self> ConstPointer;
68 itkTypeMacro(MultiThreader, Object);
82 static void SetGlobalMaximumNumberOfThreads(
ThreadIdType val);
90 static void SetGlobalDefaultUseThreadPool(
const bool GlobalDefaultUseThreadPool );
91 static bool GetGlobalDefaultUseThreadPool( );
98 static void SetGlobalDefaultNumberOfThreads(
ThreadIdType val);
106 void SingleMethodExecute();
112 void MultipleMethodExecute();
136 itkSetObjectMacro(ThreadPool, ThreadPool);
139 itkGetModifiableObjectMacro(ThreadPool, ThreadPool);
144 itkSetMacro(UseThreadPool,
bool);
147 itkGetMacro(UseThreadPool,
bool);
160 #ifdef ThreadInfoStruct 161 #undef ThreadInfoStruct 163 struct ThreadInfoStruct
171 enum { SUCCESS, ITK_EXCEPTION, ITK_PROCESS_ABORTED_EXCEPTION, STD_EXCEPTION, UNKNOWN } ThreadExitCode;
177 virtual void PrintSelf(std::ostream & os, Indent indent)
const ITK_OVERRIDE;
180 MultiThreader(
const Self &) ITK_DELETE_FUNCTION;
181 void operator=(const Self &) ITK_DELETE_FUNCTION;
184 ThreadPool::Pointer m_ThreadPool;
187 bool m_UseThreadPool;
200 int m_SpawnedThreadActiveFlag[ITK_MAX_THREADS];
201 MutexLock::Pointer m_SpawnedThreadActiveFlagLock[ITK_MAX_THREADS];
203 ThreadInfoStruct m_SpawnedThreadInfoArray[ITK_MAX_THREADS];
207 void *m_MultipleData[ITK_MAX_THREADS];
218 static
bool m_GlobalDefaultUseThreadPool;
229 static
ThreadIdType GetGlobalDefaultNumberOfThreadsByPlatform();
257 ThreadProcessIdType SpawnDispatchSingleMethodThread(ThreadInfoStruct *);
260 void SpawnWaitForSingleMethodThread(ThreadProcessIdType);
268 ThreadProcessIdType DispatchSingleMethodThread(ThreadInfoStruct *);
273 void WaitForSingleMethodThread(ThreadProcessIdType);
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
#define ITK_THREAD_RETURN_TYPE
void(* ThreadFunctionType)(void *)
unsigned int ThreadIdType
SmartPointer< Self > Pointer