Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

globalsync Class Reference

#include <globalsync.h>

     This is an abstract base class for "global" synchronizers. While conceptually global in scope, and historically global entities, each node in a distributed system may possess a global synchronizer. What distinguishes a global synchronizer from a normal one is that:

     Concrete global synchronizers are generated from user code and shall provide suitable constructors and implementations for poll_triggers() and constraint_check().

Inheritance diagram for globalsync:

actionlistener rt_sched_sync List of all members.

Public Member Functions

void poll_master ()
 globalsync (const syncref &ref, postmaster &pm)
virtual ~globalsync ()
virtual void constraint_check ()=0

Protected Types

typedef std::set< notificationnotification_list

Protected Member Functions

void start_polling ()
void end_polling ()
virtual void poll_triggers ()=0
virtual int exception_handler (const timing_exception &)=0

Protected Attributes

postmasterPostMaster
notification_list min_notes
notification_list max_notes
pthread_mutex_t m_notify_mutex
notification_list rhs
pthread_mutex_t m_rhs_mutex
syncref name

Static Protected Attributes

static const int TERMINATE = 99
static const int KILLNODE = 443556
static const int CONTINUE = 0

Private Attributes

pthread_t m_pollthread

Friends

void * start_polling_func_gs (globalsync *s)

Classes

struct  notification

Member Typedef Documentation

typedef std::set<notification> globalsync::notification_list [protected]
 

A simple typedef of a set of notifications to make the code easier to read and maintain.


Constructor & Destructor Documentation

globalsync::globalsync const syncref ref,
postmaster pm
 

Constructor, sets initial values.

ref
The name of this synchronizer.
pm
The local postmaster of this node.

virtual globalsync::~globalsync  )  [inline, virtual]
 


Member Function Documentation

virtual void globalsync::constraint_check  )  [pure virtual]
 

     This is the global synchronizer equivalent of the synchronizer's message polling. The difference is that while a point-to-point synchronizer enforces constraints, the global synchronizer merely analyses events after the fact and determines whether any constraints were violated.
     This function iterates over all the right hand sides of all constraints, and for each such right hand side, ensures that the rhs (which corresponds to an event that has happened in the system) did not violate any timing constraints, as defined by min and max notes.

void globalsync::end_polling  )  [protected]
 

Kills the polling thread. Each derived destructor must call this before destroying any of its members.

virtual int globalsync::exception_handler const timing_exception  )  [protected, pure virtual]
 

An exception handler used to process timing exceptions thrown by poll_msg(). This can execute arbitrary code, but shall return one of the symbolic constants:

TERMINATE
Terminates the system.
KILLNODE
Terminates the local node.
CONTINUE
Proceed as before.
Parameters
The single parameter is the timing exception that was thrown.
Return Value
The constant symbolizing which action should be taken due to the exception.

void globalsync::poll_master  ) 
 

Master polling function. This iterates over the internal data structures.

virtual void globalsync::poll_triggers  )  [protected, pure virtual]
 

Polls the enable/disable triggers. Do not call this member function explicitly. This functino examines certain conditions and sets and propagates the enabled/disabled status of actor methods appropriately. Each trigger is polled only once.

void globalsync::start_polling  )  [protected]
 

Starts the polling thread. Each derived constructor must call this once its members are initialized.


Friends And Related Function Documentation

void* start_polling_func_gs globalsync s  )  [friend]
 


Member Data Documentation

const int globalsync::CONTINUE = 0 [static, protected]
 

Value thrown by an exception which means that the system should proceed as before.

const int globalsync::KILLNODE = 443556 [static, protected]
 

Value thrown by an exception that means that this node should be terminated.

pthread_mutex_t globalsync::m_notify_mutex [protected]
 

Mutex to handle the synchronization of the notification list.

pthread_t globalsync::m_pollthread [private]
 

ID for the polling thread.

pthread_mutex_t globalsync::m_rhs_mutex [protected]
 

A mutex to handle the synchronization of the rhs notification list.

notification_list globalsync::max_notes [protected]
 

Notifications of max constraints.

notification_list globalsync::min_notes [protected]
 

Notifications of min constraints.

syncref globalsync::name [protected]
 

The name of this synchronizer.

postmaster& globalsync::PostMaster [protected]
 

The local postmaster.

notification_list globalsync::rhs [protected]
 

The right-hand side (rhs) of a constraint is an event that has happened in the system. This variable is a list of these.

const int globalsync::TERMINATE = 99 [static, protected]
 

Value thrown by an exception which means that the entire system should be terminated.


The documentation for this class was generated from the following files:
Generated on Wed May 24 23:03:25 2006 for RTSync by  doxygen 1.4.4