Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkThreadedController Class Reference

#include <vtkThreadedController.h>

Inheritance diagram for vtkThreadedController:

vtkMultiProcessController vtkObject vtkObjectBase List of all members.

Detailed Description

Allows communication between running threads.

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 40 of file vtkThreadedController.h.

Public Types

typedef vtkMultiProcessController Superclass

Public Member Functions

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 ***argv, int)
virtual void Initialize (int *argc, char ***argv)
virtual void Finalize ()
virtual void Finalize (int)
virtual int GetLocalProcessId ()

Static Public Member Functions

static vtkThreadedControllerNew ()
static int IsTypeOf (const char *type)
static vtkThreadedControllerSafeDownCast (vtkObject *o)

Protected Types

typedef int ThreadIdType

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

vtkThreadedController ** Controllers
ThreadIdType ThreadId
int LastNumberOfProcesses
vtkMultiThreaderMultiThreader
int MultipleMethodFlag

Static Protected Attributes

static vtkSimpleCriticalSection CounterLock
static int Counter
static int IsBarrierInProgress
static vtkSimpleCriticalSectionBarrierLock
static vtkSimpleCriticalSectionBarrierInProgress


Member Typedef Documentation

typedef vtkMultiProcessController vtkThreadedController::Superclass
 

Reimplemented from vtkMultiProcessController.

Definition at line 44 of file vtkThreadedController.h.

typedef int vtkThreadedController::ThreadIdType [protected]
 

Definition at line 108 of file vtkThreadedController.h.


Constructor & Destructor Documentation

vtkThreadedController::vtkThreadedController  )  [protected]
 

vtkThreadedController::~vtkThreadedController  )  [protected]
 


Member Function Documentation

static 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]
 

Reimplemented from vtkMultiProcessController.

static 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 vtkTypeRevisionMacro 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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkMultiProcessController.

static vtkThreadedController* vtkThreadedController::SafeDownCast vtkObject o  )  [static]
 

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 ***  argv,
int 
[inline, virtual]
 

This method is for setting up the processes.

Definition at line 49 of file vtkThreadedController.h.

References vtkMultiProcessController::Initialize().

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

This method is for setting up the processes.

virtual void vtkThreadedController::Finalize  )  [virtual]
 

This method is for setting up the processes.

Implements vtkMultiProcessController.

virtual void vtkThreadedController::Finalize int   )  [inline, virtual]
 

This method is for setting up the processes.

Implements vtkMultiProcessController.

Definition at line 53 of file vtkThreadedController.h.

References vtkMultiProcessController::Finalize().

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.

Implements 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.

Implements vtkMultiProcessController.

virtual void vtkThreadedController::Barrier  )  [virtual]
 

This method can be used to synchronize the threads.

Implements 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.

Implements vtkMultiProcessController.

void vtkThreadedController::CreateProcessControllers  )  [protected]
 

void vtkThreadedController::Start int  threadIdx  )  [protected]
 

First method called after threads are spawned.

void vtkThreadedController::ResetControllers  )  [protected]
 

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

static void vtkThreadedController::WaitForPreviousBarrierToEnd  )  [static, protected]
 

static void vtkThreadedController::BarrierStarted  )  [static, protected]
 

static void vtkThreadedController::BarrierEnded  )  [static, protected]
 

static void vtkThreadedController::SignalNextThread  )  [static, protected]
 

static void vtkThreadedController::InitializeBarrier  )  [static, protected]
 

static void vtkThreadedController::WaitForNextThread  )  [static, protected]
 

vtkMultiProcessController* vtkThreadedController::GetLocalController  )  [protected, virtual]
 

This method sends data to another process. Tag eliminates ambiguity when multiple sends or receives exist in the same process.

Reimplemented from vtkMultiProcessController.


Member Data Documentation

vtkThreadedController** vtkThreadedController::Controllers [protected]
 

Definition at line 96 of file vtkThreadedController.h.

vtkSimpleCriticalSection vtkThreadedController::CounterLock [static, protected]
 

Definition at line 114 of file vtkThreadedController.h.

int vtkThreadedController::Counter [static, protected]
 

Definition at line 115 of file vtkThreadedController.h.

int vtkThreadedController::IsBarrierInProgress [static, protected]
 

Definition at line 116 of file vtkThreadedController.h.

vtkSimpleCriticalSection* vtkThreadedController::BarrierLock [static, protected]
 

Definition at line 127 of file vtkThreadedController.h.

vtkSimpleCriticalSection* vtkThreadedController::BarrierInProgress [static, protected]
 

Definition at line 128 of file vtkThreadedController.h.

ThreadIdType vtkThreadedController::ThreadId [protected]
 

Definition at line 131 of file vtkThreadedController.h.

int vtkThreadedController::LastNumberOfProcesses [protected]
 

Definition at line 133 of file vtkThreadedController.h.

vtkMultiThreader* vtkThreadedController::MultiThreader [protected]
 

Definition at line 135 of file vtkThreadedController.h.

int vtkThreadedController::MultipleMethodFlag [protected]
 

Definition at line 137 of file vtkThreadedController.h.


The documentation for this class was generated from the following file: