Main Page
Groups
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File
List
Namespace Members
Compound Members
File Members
Concepts
itk::MultiThreader Class Reference
A class for performing multithreaded execution.
More...
#include <itkMultiThreader.h>
Inheritance diagram for itk::MultiThreader:
[legend]Collaboration diagram for itk::MultiThreader:
[legend]List of all members.
Detailed Description
A class for performing multithreaded execution.
Multithreader is a class that provides support for multithreaded execution using sproc() on an SGI, or pthread_create on any platform supporting POSIX threads. This class can be used to execute a single method on multiple threads, or to specify a method per thread.
- Note
- If ITK_USE_SPROC is defined, then sproc() will be used to create multiple threads on an SGI. If ITK_USE_PTHREADS is defined, then pthread_create() will be used to create multiple threads (on a sun, for example).
Definition at line 124 of file itkMultiThreader.h.
Member Typedef Documentation
Constructor & Destructor Documentation
itk::MultiThreader::MultiThreader |
( |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* itk::MultiThreader::GetClassName |
( |
|
) |
const [virtual] |
|
|
Run-time type information (and related methods).
Reimplemented from itk::Object.
|
int itk::MultiThreader::GetGlobalDefaultNumberOfThreads |
( |
|
) |
[static] |
|
|
Set/Get the value which is used to initialize the NumberOfThreads in the constructor. Initially this default is set to the number of processors or 8 (which ever is less). |
int itk::MultiThreader::GetGlobalMaximumNumberOfThreads |
( |
|
) |
[static] |
|
|
Set/Get the maximum number of threads to use when multithreading. This limits and overrides any other settings for multithreading. A value of zero indicates no limit. |
virtual int itk::MultiThreader::GetNumberOfThreads |
( |
|
) |
[virtual] |
|
|
Get/Set the number of threads to create. It will be clamped to the range 1 - ITK_MAX_THREADS, so the caller of this method should check that the requested number of threads was accepted. |
void itk::MultiThreader::MultipleMethodExecute |
( |
|
) |
|
|
|
Execute the MultipleMethods (as define by calling SetMultipleMethod for each of the required m_NumberOfThreads methods) using m_NumberOfThreads threads. |
Pointer itk::MultiThreader::New |
( |
|
) |
[static] |
|
|
Method for creation through the object factory.
Reimplemented from itk::Object.
|
void itk::MultiThreader::PrintSelf |
( |
std::ostream & |
os, |
|
|
Indent |
indent |
|
) |
const [protected, virtual] |
|
|
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
|
void itk::MultiThreader::SetGlobalDefaultNumberOfThreads |
( |
int |
val |
) |
[static] |
|
|
Set/Get the value which is used to initialize the NumberOfThreads in the constructor. Initially this default is set to the number of processors or 8 (which ever is less).
Referenced by main(). |
void itk::MultiThreader::SetGlobalMaximumNumberOfThreads |
( |
int |
val |
) |
[static] |
|
|
Set/Get the maximum number of threads to use when multithreading. This limits and overrides any other settings for multithreading. A value of zero indicates no limit. |
void itk::MultiThreader::SetMultipleMethod |
( |
int |
index, |
|
|
ThreadFunctionType |
, |
|
|
void * |
data |
|
) |
|
|
|
Set the MultipleMethod at the given index to f() and the UserData field of the ThreadInfoStruct that is passed to it will be data. |
virtual void itk::MultiThreader::SetNumberOfThreads |
( |
int |
_arg |
) |
[virtual] |
|
|
Get/Set the number of threads to create. It will be clamped to the range 1 - ITK_MAX_THREADS, so the caller of this method should check that the requested number of threads was accepted. |
|
Set the SingleMethod to f() and the UserData field of the ThreadInfoStruct that is passed to it will be data. This method (and all the methods passed to SetMultipleMethod) must be of type itkThreadFunctionType and must take a single argument of type void *. |
void itk::MultiThreader::SingleMethodExecute |
( |
|
) |
|
|
|
Execute the SingleMethod (as define by SetSingleMethod) using m_NumberOfThreads threads. |
|
Create a new thread for the given function. Return a thread id which is a number between 0 and ITK_MAX_THREADS - 1. This id should be used to kill the thread at a later time. |
void itk::MultiThreader::TerminateThread |
( |
int |
thread_id |
) |
|
|
|
Terminate the thread that was created with a SpawnThreadExecute() |
The documentation for this class was generated from the following file:
Generated at Sat Mar 31 02:57:58 2007 for ITK by
1.3.8 written by Dimitri van Heesch,
© 1997-2000