Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Static Public Attributes | Friends | List of all members
drwnThreadPool Class Reference

Implements a pool of threads for running concurrent jobs. More...

Public Member Functions

 drwnThreadPool (const unsigned size=MAX_THREADS)
 create a thread pool with size (<= MAX_THREADS) threads
 
void start ()
 prepare the thread pool to take jobs
 
void addJob (drwnThreadJob *job)
 add a job to the queue
 
void finish (bool bShowStatus=false)
 finish the jobs in the queue and stop
 
unsigned numThreads () const
 return the number of threads running
 
unsigned numJobsRemaining ()
 return the number of jobs remaining in the queue
 

Static Public Attributes

static unsigned MAX_THREADS = 4
 maximum number of threads allowed
 

Friends

class drwnThreadJob
 

Detailed Description

Implements a pool of threads for running concurrent jobs.

See Also
drwnThreadJob
Thread Pool

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