ldas-tools-al  2.6.7
Classes | Static Public Member Functions | Private Member Functions | List of all members
LDASTools::AL::ThreadPool Class Reference

Maintains a pool of threads. More...

#include <ThreadPool.hh>

Classes

class  UnaryFunction
 Base for unary functions to be used in ForEach call. More...
 

Static Public Member Functions

static TaskThreadAcquire ()
 Acquire a thread. More...
 
static bool Active (TaskThread *Resource)
 Check if a Thread is currently active. More...
 
static void ForEach (UnaryFunction &Func)
 Iterate over the active threads. More...
 
static void Relinquish (TaskThread *Resource)
 Return a thread to the pool. More...
 
static void Reset ()
 Release all resources from the thread pool. More...
 
static TaskThreadAcquire ()
 Acquire a thread. More...
 
static bool Active (TaskThread *Resource)
 Check if a Thread is currently active. More...
 
static void ForEach (UnaryFunction &Func)
 Iterate over the active threads. More...
 
static void Relinquish (TaskThread *Resource)
 Return a thread to the pool. More...
 
static void Reset ()
 Release all resources from the thread pool. More...
 
static TaskThreadAcquire ()
 Acquire a thread. More...
 
static bool Active (TaskThread *Resource)
 Check if a Thread is currently active. More...
 
static void ForEach (UnaryFunction &Func)
 Iterate over the active threads. More...
 
static void Relinquish (TaskThread *Resource)
 Return a thread to the pool. More...
 
static void Reset ()
 Release all resources from the thread pool. More...
 

Private Member Functions

 ThreadPool ()
 Hide default constructor. More...
 
 ThreadPool (const ThreadPool &Source)
 Hide copy constructor. More...
 
ThreadPool operator= (const ThreadPool &Source)
 Hide assignment operator. More...
 
 ThreadPool ()
 Hide default constructor. More...
 
 ThreadPool (const ThreadPool &Source)
 Hide copy constructor. More...
 
ThreadPool operator= (const ThreadPool &Source)
 Hide assignment operator. More...
 
 ThreadPool ()
 Hide default constructor. More...
 
 ThreadPool (const ThreadPool &Source)
 Hide copy constructor. More...
 
ThreadPool operator= (const ThreadPool &Source)
 Hide assignment operator. More...
 

Detailed Description

Maintains a pool of threads.

This is a singleton class that maintains a list of threads that can be reused to perform asyncronous tasks.

Constructor & Destructor Documentation

◆ ThreadPool() [1/6]

LDASTools::AL::ThreadPool::ThreadPool ( )
private

Hide default constructor.

Do not want anyone to create a seperate instance of this class.

◆ ThreadPool() [2/6]

LDASTools::AL::ThreadPool::ThreadPool ( const ThreadPool Source)
private

Hide copy constructor.

Do not want to create another instance of the class based on a priviously created instance.

◆ ThreadPool() [3/6]

LDASTools::AL::ThreadPool::ThreadPool ( )
private

Hide default constructor.

Do not want anyone to create a seperate instance of this class.

◆ ThreadPool() [4/6]

LDASTools::AL::ThreadPool::ThreadPool ( const ThreadPool Source)
private

Hide copy constructor.

Do not want to create another instance of the class based on a priviously created instance.

◆ ThreadPool() [5/6]

LDASTools::AL::ThreadPool::ThreadPool ( )
private

Hide default constructor.

Do not want anyone to create a seperate instance of this class.

◆ ThreadPool() [6/6]

LDASTools::AL::ThreadPool::ThreadPool ( const ThreadPool Source)
private

Hide copy constructor.

Do not want to create another instance of the class based on a priviously created instance.

Member Function Documentation

◆ Acquire() [1/3]

TaskThread * LDASTools::AL::ThreadPool::Acquire ( )
static

Acquire a thread.

Returns
A resouce from the pool.

Secure a resource from the pool of resouces. If there is no resouce available at the time of the call, a new resouce is allocated and returned to the caller.

◆ Acquire() [2/3]

static TaskThread* LDASTools::AL::ThreadPool::Acquire ( )
static

Acquire a thread.

Returns
A resouce from the pool.

◆ Acquire() [3/3]

static TaskThread* LDASTools::AL::ThreadPool::Acquire ( )
static

Acquire a thread.

Returns
A resouce from the pool.

◆ Active() [1/3]

bool LDASTools::AL::ThreadPool::Active ( TaskThread Resource)
static

Check if a Thread is currently active.

Check for Resource.

Parameters
[in]ResourceCheck a resouce if in the pool.

◆ Active() [2/3]

static bool LDASTools::AL::ThreadPool::Active ( TaskThread Resource)
static

Check if a Thread is currently active.

Parameters
[in]ResourceCheck a resouce if in the pool.

◆ Active() [3/3]

static bool LDASTools::AL::ThreadPool::Active ( TaskThread Resource)
static

Check if a Thread is currently active.

Parameters
[in]ResourceCheck a resouce if in the pool.

◆ ForEach() [1/3]

static void LDASTools::AL::ThreadPool::ForEach ( UnaryFunction Func)
static

Iterate over the active threads.

Parameters
[in]FuncFunction to execute.

◆ ForEach() [2/3]

static void LDASTools::AL::ThreadPool::ForEach ( UnaryFunction Func)
static

Iterate over the active threads.

Parameters
[in]FuncFunction to execute.

◆ ForEach() [3/3]

void LDASTools::AL::ThreadPool::ForEach ( UnaryFunction Func)
static

Iterate over the active threads.

Loop over each active thread in a thread safe manor.

Parameters
[in]FuncFunction to execute.

◆ operator=() [1/3]

ThreadPool LDASTools::AL::ThreadPool::operator= ( const ThreadPool Source)
private

Hide assignment operator.

Do not want to copy one instance to another.

◆ operator=() [2/3]

ThreadPool LDASTools::AL::ThreadPool::operator= ( const ThreadPool Source)
private

Hide assignment operator.

Do not want to copy one instance to another.

◆ operator=() [3/3]

ThreadPool LDASTools::AL::ThreadPool::operator= ( const ThreadPool Source)
private

Hide assignment operator.

Do not want to copy one instance to another.

◆ Relinquish() [1/3]

static void LDASTools::AL::ThreadPool::Relinquish ( TaskThread Resource)
static

Return a thread to the pool.

Parameters
[in]ResourceReturn a resouce to the pool.

◆ Relinquish() [2/3]

void LDASTools::AL::ThreadPool::Relinquish ( TaskThread Resource)
static

Return a thread to the pool.

Recyle the resource.

Parameters
[in]ResourceReturn a resouce to the pool.

◆ Relinquish() [3/3]

static void LDASTools::AL::ThreadPool::Relinquish ( TaskThread Resource)
static

Return a thread to the pool.

Parameters
[in]ResourceReturn a resouce to the pool.

◆ Reset() [1/3]

static void LDASTools::AL::ThreadPool::Reset ( )
static

Release all resources from the thread pool.

◆ Reset() [2/3]

void LDASTools::AL::ThreadPool::Reset ( )
static

Release all resources from the thread pool.

Note
This method should not be called by others. It is provided to help facilitate cleanup at program exit.

Get rid of threads currently doing something interesting

Get rid of threads waiting to do something interesting

◆ Reset() [3/3]

static void LDASTools::AL::ThreadPool::Reset ( )
static

Release all resources from the thread pool.


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