Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

RazorBack::MTmgrbase_ Class Reference

Class MTmgrbase_: abstract base class for the management of threads. More...

#include <MTmgr.hh>

Inheritance diagram for RazorBack::MTmgrbase_:

Inheritance graph
[legend]
List of all members.

Public Methods

 MTmgrbase_ ()
 Init to empty.

virtual ~MTmgrbase_ ()
 dtor: reap all threads still running.

virtual size_t launch (size_t Threadno, Threadstartfn_ Startfn, void *Arg)=0
 launch(Threadno, Startfn, Arg): launches Threadno threads. More...

virtual void reap ()=0
 reap(): reap all threads currently running. More...

virtual void reap (pthread_t ID)=0
bool empty () const
 empty(): returns true when no threads are running.

size_t thread_no () const
 thread_no(): returns the number of currently running threads.

bool is_running (pthread_t ID) const
 is_running(ID): returns true if the thread identified by ID is running.

const list<pthread_t>& run_list () const
 run_list(): enables const access to the list of thread IDs.


Static Public Methods

size_t get_cpuno ()
 get_cpuno(): returns the number of CPUs. More...


Protected Attributes

list<pthread_t> Threads
 list of thread IDs.


Private Methods

 MTmgrbase_ (const MTmgrbase_ &)
MTmgrbase_& operator= (const MTmgrbase_ &)

Detailed Description

Class MTmgrbase_: abstract base class for the management of threads.

Classes derived from this ABC can launch new threads and stop them (all or some).

Definition at line 62 of file MTmgr.hh.


Constructor & Destructor Documentation

RazorBack::MTmgrbase_::MTmgrbase_ ( ) [inline]
 

Init to empty.

Definition at line 74 of file MTmgr.hh.

RazorBack::MTmgrbase_::~MTmgrbase_ ( ) [inline, virtual]
 

dtor: reap all threads still running.

Definition at line 77 of file MTmgr.hh.

RazorBack::MTmgrbase_::MTmgrbase_ ( const MTmgrbase_ & ) [private]
 


Member Function Documentation

size_t RazorBack::MTmgrbase_::launch ( size_t Threadno,
Threadstartfn_ Startfn,
void * Arg ) [pure virtual]
 

launch(Threadno, Startfn, Arg): launches Threadno threads.

These start execution in the global C function pointed to by Startfn, with argument Arg. Returns the number of threads actually launched.

Reimplemented in RazorBack::MTmgrjoin_, and RazorBack::MTmgrdetach_.

void RazorBack::MTmgrbase_::reap ( ) [pure virtual]
 

reap(): reap all threads currently running.

reap(ID): reap the thread identified by ID. Do nothing if that ID is nonexistent.

Reimplemented in RazorBack::MTmgrjoin_, and RazorBack::MTmgrdetach_.

virtual void RazorBack::MTmgrbase_::reap ( pthread_t ID ) [pure virtual]
 

Reimplemented in RazorBack::MTmgrjoin_, and RazorBack::MTmgrdetach_.

size_t RazorBack::MTmgrbase_::get_cpuno ( ) [static]
 

get_cpuno(): returns the number of CPUs.

Very architecture- and OS-dependent.

bool RazorBack::MTmgrbase_::empty ( ) const [inline]
 

empty(): returns true when no threads are running.

Definition at line 106 of file MTmgr.hh.

size_t RazorBack::MTmgrbase_::thread_no ( ) const [inline]
 

thread_no(): returns the number of currently running threads.

Definition at line 109 of file MTmgr.hh.

bool RazorBack::MTmgrbase_::is_running ( pthread_t ID ) const
 

is_running(ID): returns true if the thread identified by ID is running.

const list< pthread_t > & RazorBack::MTmgrbase_::run_list ( ) const [inline]
 

run_list(): enables const access to the list of thread IDs.

Definition at line 121 of file MTmgr.hh.

MTmgrbase_& RazorBack::MTmgrbase_::operator= ( const MTmgrbase_ & ) [private]
 


Member Data Documentation

list< pthread_t > RazorBack::MTmgrbase_::Threads<pthread_t> [protected]
 

list of thread IDs.

Definition at line 68 of file MTmgr.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:34 2002 for The Razorback C++ Library: POSIX Thread Wrappers by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001