library of assembled shared sources

http://lass.cocamware.com

lass::util::Signaled Class Reference
[Threading]

implementation of ThreadPool's IdlePolicy More...

#include <thread_pool.h>

Collaboration diagram for lass::util::Signaled:

Collaboration graph
[legend]

Protected Member Functions

 Signaled ()
 ~Signaled ()
void sleepProducer ()
void wakeProducer ()
void sleepConsumer ()
void wakeConsumer ()
void wakeAllConsumers ()

Private Types

enum  { mSecsToSleep_ = 50 }

Private Attributes

Condition producer_
Condition consumer_

Detailed Description

implementation of ThreadPool's IdlePolicy

See also:
ThreadPool
Idle threads are put to sleep and signaled to awake when a condition is met. It results in a slower response of the threads, but it avoids wasting cpu cycles to idle threads.

Definition at line 178 of file thread_pool.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
mSecsToSleep_ 

Definition at line 189 of file thread_pool.h.


Constructor & Destructor Documentation

lass::util::Signaled::Signaled (  )  [inline, protected]

Definition at line 181 of file thread_pool.h.

lass::util::Signaled::~Signaled (  )  [inline, protected]

Definition at line 182 of file thread_pool.h.


Member Function Documentation

void lass::util::Signaled::sleepProducer (  )  [inline, protected]

Definition at line 183 of file thread_pool.h.

References mSecsToSleep_, producer_, and lass::util::Condition::wait().

void lass::util::Signaled::wakeProducer (  )  [inline, protected]

Definition at line 184 of file thread_pool.h.

References producer_, and lass::util::Condition::signal().

void lass::util::Signaled::sleepConsumer (  )  [inline, protected]

Definition at line 185 of file thread_pool.h.

References consumer_, mSecsToSleep_, and lass::util::Condition::wait().

void lass::util::Signaled::wakeConsumer (  )  [inline, protected]

Definition at line 186 of file thread_pool.h.

References consumer_, and lass::util::Condition::signal().

void lass::util::Signaled::wakeAllConsumers (  )  [inline, protected]

Definition at line 187 of file thread_pool.h.

References lass::util::Condition::broadcast(), and consumer_.


Field Documentation

Definition at line 190 of file thread_pool.h.

Referenced by sleepProducer(), and wakeProducer().

Definition at line 191 of file thread_pool.h.

Referenced by sleepConsumer(), wakeAllConsumers(), and wakeConsumer().


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

Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo