Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkThreadedController Class Reference

Allows communication between running threads. More...

#include <vtkThreadedController.h>

Inheritance diagram for vtkThreadedController:

Inheritance graph
[legend]
Collaboration diagram for vtkThreadedController:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void SingleMethodExecute ()
virtual void MultipleMethodExecute ()
virtual void Barrier ()
virtual void CreateOutputWindow ()
virtual void Initialize (int *argc, char ***arcv)
virtual void Finalize ()
virtual int GetLocalProcessId ()

Static Public Methods

vtkThreadedController * New ()
int IsTypeOf (const char *type)
vtkThreadedController * SafeDownCast (vtkObject *o)

Protected Types

typedef int ThreadIdType

Protected Methods

 vtkThreadedController ()
 ~vtkThreadedController ()
void CreateProcessControllers ()
void Start (int threadIdx)
void ResetControllers ()
vtkMultiProcessControllerGetLocalController ()

Static Protected Methods

VTK_THREAD_RETURN_TYPE vtkThreadedControllerStart (void *arg)
void WaitForPreviousBarrierToEnd ()
void BarrierStarted ()
void BarrierEnded ()
void SignalNextThread ()
void InitializeBarrier ()
void WaitForNextThread ()

Protected Attributes

vtkThreadedController ** Controllers
ThreadIdTypeThreadIds
int LastNumberOfProcesses
vtkMultiThreaderMultiThreader
int MultipleMethodFlag

Static Protected Attributes

vtkSimpleCriticalSection CounterLock
int Counter
int IsBarrierInProgress
vtkSimpleCriticalSection BarrierLock
vtkSimpleCriticalSection BarrierInProgress

Detailed Description

Allows communication between running threads.

Date:
2001/10/11 13:38:01
Revision:
1.6

vtkThreadedController uses a vtkMultiThreader to spawn threads. The communication is accomplished using a vtkSharedMemoryCommunicator. The RMI communicator is identical to the user communicator. Note that each thread gets its own vtkThreadedController to accomplish thread safety.

See also:
vtkMultiProcessController vtkMultiThreader vtkSharedMemoryCommunicator vtkInputPort vtkOutputPort
Tests:
vtkThreadedController (Tests)

Definition at line 68 of file vtkThreadedController.h.


Member Typedef Documentation

typedef int vtkThreadedController::ThreadIdType [protected]
 

Definition at line 135 of file vtkThreadedController.h.


Constructor & Destructor Documentation

vtkThreadedController::vtkThreadedController   [protected]
 

vtkThreadedController::~vtkThreadedController   [protected]
 


Member Function Documentation

vtkThreadedController* vtkThreadedController::New   [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkMultiProcessController.

virtual const char* vtkThreadedController::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMultiProcessController.

int vtkThreadedController::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMultiProcessController.

virtual int vtkThreadedController::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMultiProcessController.

vtkThreadedController* vtkThreadedController::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkMultiProcessController.

void vtkThreadedController::PrintSelf ostream &    os,
vtkIndent    indent
[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 vtkMultiProcessController.

virtual void vtkThreadedController::Initialize int *    argc,
char ***    arcv
[virtual]
 

This method is for setting up the processes.

virtual void vtkThreadedController::Finalize   [inline, virtual]
 

This method is for setting up the processes.

Reimplemented from vtkMultiProcessController.

Definition at line 78 of file vtkThreadedController.h.

virtual int vtkThreadedController::GetLocalProcessId   [virtual]
 

This method returns an integer from 0 to (NumberOfProcesses-1) indicating which process we are in. Note: The correct controller is passed as an argument to the initial function (SingleMethod/MultipleMethod). Calling this method on another controller may give wrong results.

Reimplemented from vtkMultiProcessController.

virtual void vtkThreadedController::SingleMethodExecute   [virtual]
 

Execute the SingleMethod (as define by SetSingleMethod) using this->NumberOfProcesses processes. This will only return when all the processes finish executing their methods.

Reimplemented from vtkMultiProcessController.

virtual void vtkThreadedController::MultipleMethodExecute   [virtual]
 

Execute the MultipleMethods (as define by calling SetMultipleMethod for each of the required this->NumberOfProcesses methods) using this->NumberOfProcesses processes.

Reimplemented from vtkMultiProcessController.

virtual void vtkThreadedController::Barrier   [virtual]
 

This method can be used to synchronize the threads.

Reimplemented from vtkMultiProcessController.

virtual void vtkThreadedController::CreateOutputWindow   [virtual]
 

This method can be used to tell the controller to create a special output window in which all messages are preceded by the process id.

Reimplemented from vtkMultiProcessController.

void vtkThreadedController::CreateProcessControllers   [protected]
 

void vtkThreadedController::Start int    threadIdx [protected]
 

First method called after threads are spawned.

void vtkThreadedController::ResetControllers   [protected]
 

VTK_THREAD_RETURN_TYPE vtkThreadedController::vtkThreadedControllerStart void *    arg [static, protected]
 

void vtkThreadedController::WaitForPreviousBarrierToEnd   [static, protected]
 

void vtkThreadedController::BarrierStarted   [static, protected]
 

void vtkThreadedController::BarrierEnded   [static, protected]
 

void vtkThreadedController::SignalNextThread   [static, protected]
 

void vtkThreadedController::InitializeBarrier   [static, protected]
 

void vtkThreadedController::WaitForNextThread   [static, protected]
 

vtkMultiProcessController* vtkThreadedController::GetLocalController   [protected, virtual]
 

Reimplemented from vtkMultiProcessController.


Member Data Documentation

vtkThreadedController** vtkThreadedController::Controllers [protected]
 

Definition at line 123 of file vtkThreadedController.h.

vtkSimpleCriticalSection vtkThreadedController::CounterLock [static, protected]
 

Definition at line 141 of file vtkThreadedController.h.

int vtkThreadedController::Counter [static, protected]
 

Definition at line 142 of file vtkThreadedController.h.

int vtkThreadedController::IsBarrierInProgress [static, protected]
 

Definition at line 143 of file vtkThreadedController.h.

vtkSimpleCriticalSection vtkThreadedController::BarrierLock [static, protected]
 

Definition at line 154 of file vtkThreadedController.h.

vtkSimpleCriticalSection vtkThreadedController::BarrierInProgress [static, protected]
 

Definition at line 155 of file vtkThreadedController.h.

ThreadIdType* vtkThreadedController::ThreadIds [protected]
 

Definition at line 158 of file vtkThreadedController.h.

int vtkThreadedController::LastNumberOfProcesses [protected]
 

Definition at line 160 of file vtkThreadedController.h.

vtkMultiThreader* vtkThreadedController::MultiThreader [protected]
 

Definition at line 162 of file vtkThreadedController.h.

int vtkThreadedController::MultipleMethodFlag [protected]
 

Definition at line 164 of file vtkThreadedController.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 14:43:53 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001