#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:
Inheritance diagram for globalsync:
Public Member Functions | |
void | poll_master () |
globalsync (const syncref &ref, postmaster &pm) | |
virtual | ~globalsync () |
virtual void | constraint_check ()=0 |
Protected Types | |
typedef std::set< notification > | notification_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 | |
postmaster & | PostMaster |
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 |
|
A simple typedef of a set of notifications to make the code easier to read and maintain. |
|
Constructor, sets initial values.
|
|
|
|
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. |
|
Kills the polling thread. Each derived destructor must call this before destroying any of its members. |
|
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:
|
|
Master polling function. This iterates over the internal data structures. |
|
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. |
|
Starts the polling thread. Each derived constructor must call this once its members are initialized. |
|
|
|
Value thrown by an exception which means that the system should proceed as before. |
|
Value thrown by an exception that means that this node should be terminated. |
|
Mutex to handle the synchronization of the notification list. |
|
ID for the polling thread. |
|
A mutex to handle the synchronization of the rhs notification list. |
|
Notifications of max constraints. |
|
Notifications of min constraints. |
|
The name of this synchronizer. |
|
The local postmaster. |
|
The right-hand side (rhs) of a constraint is an event that has happened in the system. This variable is a list of these. |
|
Value thrown by an exception which means that the entire system should be terminated. |