Book contents
- Frontmatter
- Contents
- List of illustrations
- List of tables
- Foreword
- Preface
- 1 Introduction and overview
- 2 Sequential programming with Ada
- 3 Task basics
- 4 Communication and synchronization based on shared objects
- 5 Communication and synchronization based on direct interaction
- 6 Distributed systems with Ada
- 7 Real-time systems and scheduling concepts
- 8 Real-time programming with Ada
- 9 Tools for building and verifying real-time applications
- References
- Index
5 - Communication and synchronization based on direct interaction
Published online by Cambridge University Press: 01 June 2011
- Frontmatter
- Contents
- List of illustrations
- List of tables
- Foreword
- Preface
- 1 Introduction and overview
- 2 Sequential programming with Ada
- 3 Task basics
- 4 Communication and synchronization based on shared objects
- 5 Communication and synchronization based on direct interaction
- 6 Distributed systems with Ada
- 7 Real-time systems and scheduling concepts
- 8 Real-time programming with Ada
- 9 Tools for building and verifying real-time applications
- References
- Index
Summary
In Chapter 4 we showed how protected objects can provide an indirect means for tasks to communicate and synchronize. Protected functions and procedures provide safe access to shared data while protected entries provide the means for tasks to synchronize their activities. In this chapter we look at direct communication between tasks through Ada's rendezvous.
The rendezvous
Rendezvous is a sixteenth century French word which literally translates to “present yourself.” To rendezvous is to come together at a prearranged meeting place. In Ada, the rendezvous is a mechanism for controlled direct interaction between two tasks. The rendezvous provides a second way to synchronize tasks and transfer data between them.
Ada's rendezvous is based on a client-server model. One task, called the server, declares one or more services that it can offer to other tasks, the clients. These services are defined as entries in the server task's specification. Task entries are similar to protected entries. In fact, we may requeue a protected entry call onto a task entry and vice versa. A client task requests a rendezvous with a server by making entry calls just as if the server was a protected object. Server tasks indicate a willingness to accept a rendezvous on an entry by executing an accept statement. The accept statement may include code to be executed during the rendezvous.
For the rendezvous to take place, both the client and the server must have issued their requests.
- Type
- Chapter
- Information
- Building Parallel, Embedded, and Real-Time Applications with Ada , pp. 166 - 194Publisher: Cambridge University PressPrint publication year: 2011