ABSTRACT

This chapter addresses the topic, explaining how shared variables can be used for communication and introducing various kinds of hardware- and software-based synchronization approaches. At first sight, using a set of shared variables for interprocess communication may seem a rather straightforward extension of what is usually done in sequential programming. However, semaphores are also a very low-level interprocess communication mechanism. A higher-level and more structured interprocess communication mechanism, called monitor, was proposed by Brinch Hansen and Hoare. It is interesting to note that, even if these proposals date back to the early '70s, they were already based on concepts that are common nowadays and known as object-oriented programming. Unsurprisingly, that counterpart does exist and takes the form of a third kind of component belonging to a monitor: the condition variables. Condition variables can be used only by the methods of the monitor they belong to, and cannot be referenced in any way from outside the monitor boundary.