Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkThreadMaster Class Reference

mitkThreadMaster - encapsulates a master of the master/worker model More...

#include <mitkThreadMasterWorker.h>

Inherits mitkObject.

Inheritance diagram for mitkThreadMaster:

Inheritance graph
[legend]
Collaboration diagram for mitkThreadMaster:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int GetThreadNumber () const
void DoTasks (unsigned long taskNumber, unsigned long startID=0, void *taskBag=NULL)

Detailed Description

mitkThreadMaster - encapsulates a master of the master/worker model

mitkThreadMaster encapsulates a master of the master/worker model It creates workers when it is initialized either by a "worker creator" or by duplicating an existing "sample worker". If workers are created by duplication, the "sample worker" itself will be referenced as one of the workers. And then, the master creates corresponding threads to drive the workers.


Member Function Documentation

void mitkThreadMaster::DoTasks unsigned long  taskNumber,
unsigned long  startID = 0,
void *  taskBag = NULL
 

When this function is called, threads are waken up to drive the workers. Tasks are dynamically scheduled, which means a worker will receive a new task immediately after it finishes its current one. The function won't return until all scheduled tasks are done.

Parameters:
taskNumber Specify how many tasks to be scheduled
startID Specify where the ID of tasks starts from
taskBag Sent to workers to describe current group of tasks

int mitkThreadMaster::GetThreadNumber  )  const [inline]
 

Get the number of threads spawned.

Returns:
Return the number of threads spawned.


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:06:36 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3