Rendez Vous

RendezVous literally means meeting in French. In the LockBasedSynchronization world, RendezVous is a synchronization mechanism which allows two processes to communicate and synchronize.

(The following explanation was moved from AbstractionInversion)

Could someone explain the Rendezvous example in English?

An AdaLanguage Rendezvous is a SynchronizationPrimitive?, very much like RPC, through which two or more concurrent tasks coordinate their activities and pass data. The task calling the rendezvous blocks until another task is ready to be called. A task being called through a rendezvous blocks until another task is ready to call it, receives the data, executes the "RPC" and passes data back to the caller.

An advantage of the rendezvous abstraction is that it doesn't need any additional space to store the data passed between tasks beyond the space used to store the data in each task's private memory space. When both tasks are ready to communicate the value is copied directly from the variables of one task into those of the other.

A disadvantage of the rendezvous abstraction is that, unlike message queues, it doesn't support asynchronous communication between tasks. In Ada, higher level synchronization abstractions such as message queues need to be implemented using additional tasks and rendezvous, all encapsulated within a module.

A rendezvous is more complex than a simple mutex, since it encapsulates both synchronization and communication. In fact, you cannot implement rendezvous directly with only a single mutex; you need a mutex and a semaphore (or two semaphores). So if you want to use a mutex in Ada, you need to implement a mutex using a rendezvous. This is an AbstractionInversion -- you would be implementing a simple abstraction using a more complex abstraction.

(Aside: This is really a moot point: Ada encourages concurrent programs to be designed as tasks that communicate through message passing, so using mutexes to protect shared data is going against the "grain" of the language. Given that, Ada 95 also provides protected objects, i.e. shared data with mutex, directly with language constructs.)


Also see SynchronizationStrategies, LockBasedSynchronization, SemaphoresForMutualExclusion.


CategoryAbstraction


EditText of this page (last edited November 6, 2012) or FindPage with title or text search