class VThreadPool

this class creates an abstraction for doing work in multiple threads

Public Methods

void addFunctor(const VFunctor& functor) throw(VThreadInitException&)
add a functor to the thread pool to be worked on
const ListOfThreads& getWorkerThreads()
get a list of the worker threads
void shutdown(bool finish = true)
shutdown the threadpool
VThreadPool(int numThreads = 1)
constructor
static void* workerProc(void* arg)
call from the thread construction function
virtual ~VThreadPool()
destructor

Private Methods

void init() throw(VThreadInitException&)
initialize the code

Documentation

this class creates an abstraction for doing work in multiple threads. VFunctors may be added the work queue. The waiting threads of the ThreadPool do the work specified by each VFunctor in the work queue. When the work is done, the thread returns to the thread pool, doing more work if there are any jobs in the work queue or, waiting until there is more work to be done if there are not.
VThreadPool(int numThreads = 1)
constructor

virtual ~VThreadPool()
destructor

void addFunctor(const VFunctor& functor) throw(VThreadInitException&)
add a functor to the thread pool to be worked on

void shutdown(bool finish = true)
shutdown the threadpool. if the finish flag is true, wait till the entire work queue is done

const ListOfThreads& getWorkerThreads()
get a list of the worker threads

static void* workerProc(void* arg)
call from the thread construction function

void init() throw(VThreadInitException&)
initialize the code


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++