2005/5/9

     
 

class ThreadPool

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::make::ThreadPool Class Reference

#include <ThreadPool.h>

Inheritance diagram for acdk::make::ThreadPool:

acdk::lang::Thread acdk::lang::Object acdk::lang::Runnable acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

A pool of Threads to handle short requests very quickly without the overhead to create a thread for each request API: ACDK

Author:
Roger Rene Kommer (mailto:kommer@artefaktur.com)
Version:
Revision
1.7
Date:
Date
2005/04/08 10:53:20
See also:
PoolThread


Public Member Functions

 ThreadPool (int minCount, int maxCount)
 
  • obj ObjectCreator, which must create an instance of PooledThread.


bool shutdown ()
void enqeue (IN(RJob) runnable)
RJob dequeue ()
void doShutdown ()
void setJobResult (JobResult result)
int failedCount ()
void startJob (IN(RJob) runnable)
virtual void run ()
 overload this method to implement working code for this thread


Protected Attributes

RPooledThreadArray _threads
 contains PooledThread

::acdk::util::RVector _queue
 contains Jobs

int _minCount
int _maxCount
int _shutdown
int _failedCount
::acdk::lang::sys::core_semaphore _freeThread


Constructor & Destructor Documentation

acdk::make::ThreadPool::ThreadPool int  minCount,
int  maxCount
 

  • obj ObjectCreator, which must create an instance of PooledThread.


Member Function Documentation

RJob acdk::make::ThreadPool::dequeue  ) 
 

void acdk::make::ThreadPool::doShutdown  ) 
 

void acdk::make::ThreadPool::enqeue IN(RJob runnable  ) 
 

int acdk::make::ThreadPool::failedCount  )  [inline]
 

virtual void acdk::make::ThreadPool::run  )  [virtual]
 

overload this method to implement working code for this thread

Reimplemented from acdk::lang::Thread.

void acdk::make::ThreadPool::setJobResult JobResult  result  ) 
 

bool acdk::make::ThreadPool::shutdown  )  [inline]
 

void acdk::make::ThreadPool::startJob IN(RJob runnable  ) 
 


Member Data Documentation

int acdk::make::ThreadPool::_failedCount [protected]
 

::acdk::lang::sys::core_semaphore acdk::make::ThreadPool::_freeThread [protected]
 

int acdk::make::ThreadPool::_maxCount [protected]
 

int acdk::make::ThreadPool::_minCount [protected]
 

::acdk::util::RVector acdk::make::ThreadPool::_queue [protected]
 

contains Jobs

int acdk::make::ThreadPool::_shutdown [protected]
 

RPooledThreadArray acdk::make::ThreadPool::_threads [protected]
 

contains PooledThread