Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-22dnz Total loading time: 0 Render date: 2024-04-27T06:02:07.380Z Has data issue: false hasContentIssue false

4 - Communication and synchronization based on shared objects

Published online by Cambridge University Press:  01 June 2011

John W. McCormick
Affiliation:
University of Northern Iowa
Frank Singhoff
Affiliation:
Université de Bretagne Occidentale
Jérôme Hugues
Affiliation:
Institute for Space and Aeronautics Engineering (ISAE), Toulouse
Get access

Summary

In Chapter 3 we introduced the task. The tasks in all of the examples in that chapter were independent. They did not share any resources nor did they communicate with each other. As suggested by the cooking examples of Chapter 1, the solution to most parallel problems requires cooperation among tasks. Such cooperation involves communication, mutual exclusion, and synchronization. Communication is the exchange of data or control signals between processes. Mutual exclusion is a mechanism that prevents two processes from simultaneously using the same resource. Synchronization ensures that multiple processes working on a job complete the steps of that job in the correct order. There are two approaches for communication among processes. In this chapter we look at indirect communication via shared objects. In Chapter 5, we'll look at direct communication via Ada's rendezvous mechanism.

Mutual exclusion

Let's start with a simple example that illustrates the need for mutually exclusive access to a resource used by multiple tasks. A small but popular museum has a limited capacity. When that capacity is reached, the sale of tickets must be suspended until space is made available by the departure of some visitors. Recently, the museum has installed turnstiles at each of its four entrances and hired a programmer to write the software to monitor the turnstiles and keep count of the number of visitors currently in the museum.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2011

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×