ALBA
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
albaMultiThreader Class Reference

#include <albaMultiThreader.h>

Inheritance diagram for albaMultiThreader:
Inheritance graph
[legend]
Collaboration diagram for albaMultiThreader:
Collaboration graph
[legend]

Classes

class  mmuThreadInfo
 

Public Types

typedef void(* albaThreadFunctionType) (mmuThreadInfoStruct *)
 

Public Member Functions

 albaMultiThreader ()
 
 ~albaMultiThreader ()
 
void Print (std::ostream &os, const int tabs)
 
int SpawnThread (albaThreadFunctionType, void *UserData)
 
void TerminateThread (int thread_id)
 

Protected Attributes

mmuThreadInfo m_ThreadInfoArray [ALBA_MAX_THREADS]
 
int m_SpawnedThreadActiveFlag [ALBA_MAX_THREADS]
 
albaMutexLockm_SpawnedThreadActiveFlagLock [ALBA_MAX_THREADS]
 
mmuThreadProcessIDType m_SpawnedThreadProcessID [ALBA_MAX_THREADS]
 
mmuThreadInfo m_SpawnedThreadInfoArray [ALBA_MAX_THREADS]
 

Detailed Description

albaMultiThreader - A class for performing multithreaded execution.

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

Definition at line 75 of file albaMultiThreader.h.

Member Typedef Documentation

◆ albaThreadFunctionType

typedef void(* albaMultiThreader::albaThreadFunctionType) (mmuThreadInfoStruct *)

Definition at line 105 of file albaMultiThreader.h.

Constructor & Destructor Documentation

◆ albaMultiThreader()

albaMultiThreader::albaMultiThreader ( )

◆ ~albaMultiThreader()

albaMultiThreader::~albaMultiThreader ( )

Member Function Documentation

◆ Print()

void albaMultiThreader::Print ( std::ostream &  os,
const int  tabs 
)

◆ SpawnThread()

int albaMultiThreader::SpawnThread ( albaThreadFunctionType  ,
void *  UserData 
)

Create a new thread for the given function.

Return a thread id which is a number between 0 and ALBA_MAX_THREADS - 1. This id should be used to kill the thread at a later time.

◆ TerminateThread()

void albaMultiThreader::TerminateThread ( int  thread_id)

Terminate the thread that was created with a SpawnThreadExecute()

Member Data Documentation

◆ m_ThreadInfoArray

mmuThreadInfo albaMultiThreader::m_ThreadInfoArray[ALBA_MAX_THREADS]
protected

An array of thread info containing a thread id (0, 1, 2, .

. ALBA_MAX_THREADS-1), the thread count, and a pointer to void so that user data can be passed to each thread

Definition at line 122 of file albaMultiThreader.h.

◆ m_SpawnedThreadActiveFlag

int albaMultiThreader::m_SpawnedThreadActiveFlag[ALBA_MAX_THREADS]
protected

Storage of MutexFunctions and ints used to control spawned threads and the spawned thread ids.

Definition at line 127 of file albaMultiThreader.h.

◆ m_SpawnedThreadActiveFlagLock

albaMutexLock* albaMultiThreader::m_SpawnedThreadActiveFlagLock[ALBA_MAX_THREADS]
protected

Definition at line 128 of file albaMultiThreader.h.

◆ m_SpawnedThreadProcessID

mmuThreadProcessIDType albaMultiThreader::m_SpawnedThreadProcessID[ALBA_MAX_THREADS]
protected

Definition at line 129 of file albaMultiThreader.h.

◆ m_SpawnedThreadInfoArray

mmuThreadInfo albaMultiThreader::m_SpawnedThreadInfoArray[ALBA_MAX_THREADS]
protected

Definition at line 130 of file albaMultiThreader.h.


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