Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ost::Runlist Class Reference

A runlist is used to restrict concurrent exection to a limited set of concurrent sessions, much like a semaphore. list of runable objects. More...

#include <misc.h>

Inheritance diagram for ost::Runlist::

ost::Mutex List of all members.

Public Methods

 Runlist (unsigned count=1)
 Create a new runlist with a specified limit. More...

bool add (Runable *run)
 Add a runable object to this runlist. More...

void del (Runable *run)
 Remove a runable object from the wait list or notify when it is done running so that the used count can be decremented. More...

void set (unsigned limit)
 Set the limit. More...


Protected Methods

void check (void)

Protected Attributes

unsigned limit
unsigned used

Detailed Description

A runlist is used to restrict concurrent exection to a limited set of concurrent sessions, much like a semaphore. list of runable objects.

However, the runlist differs in that it notifies objects when they become ready to run, rather than requiring them to wait and "block" for the semaphore count to become low enough to continue.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ost::Runlist::Runlist ( unsigned count = 1 )
 

Create a new runlist with a specified limit.

Parameters:
count   limit before wait queuing.


Member Function Documentation

bool ost::Runlist::add ( Runable * run )
 

Add a runable object to this runlist.

If the number of entries running is below the limit, then add returns true otherwise the entry is added to the list.

Returns:
true if immediately ready to run
Parameters:
run   pointer to runable object.

void ost::Runlist::check ( void ) [protected]
 

void ost::Runlist::del ( Runable * run )
 

Remove a runable object from the wait list or notify when it is done running so that the used count can be decremented.

Parameters:
run   pointer to runable object.

void ost::Runlist::set ( unsigned limit )
 

Set the limit.

Parameters:
limit   to use.


Member Data Documentation

unsigned ost::Runlist::limit [protected]
 

unsigned ost::Runlist::used [protected]
 


The documentation for this class was generated from the following file:
Generated at Sat May 12 18:59:43 2007 for GNU CommonC++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001