Main Page   Class Hierarchy   Compound List   Compound Members  

ArTaskPool Class Reference

A thread pool for running functions or ArPeriodicTasks. More...

#include <ArTaskPool.h>

List of all members.

Public Methods

 ArTaskPool ()
 Constructor.

virtual ~ArTaskPool ()
 Destructor.

virtual bool runTask (ArFunctor *task)
 Run a function as a periodic task.

virtual bool runTask (ArPeriodicTask *task)
 Run a periodic task.

virtual void init (int minLimit=1, int maxLimit=0)
 Init the pool.

virtual void uninit ()
 Uninit the pool. Blocks till all tasks exit.

virtual void forceUninit ()
 Force all tasks to exit, then uninit the pool.


Static Public Methods

ArTaskPool * getPool ()
 Get a pointer to the 'single' instance of ArTaskPool.

void setPool (ArTaskPool *pool)
 Set the pointer to the 'single' instance of ArTaskPool.


Static Public Attributes

ArTaskPool * ourPool = 0


Detailed Description

A thread pool for running functions or ArPeriodicTasks.


Member Data Documentation

ArTaskPool * ArTaskPool::ourPool = 0 [static]
 

When tasks need to be run, threads will be created based upon the need. See setTaskMaxLimit() about this. If minLimit is greater than 0 and there are more threads than minLimit, the extra threads will be destroyed. If minLimit is 0, then all threads will be immediately destroyed after the task is done.

Parameters:
minLimit  minimum number of threads that exist at once
See also:
setTaskMaxLimit


The documentation for this class was generated from the following files:
Generated on Tue Nov 12 17:44:06 2002 for Aria by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001