O'Reilly logo

Operating Systems: Concurrent and Distributed Software Design by Tim Harris, Jean Bacon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.2. Monitors

The critical region construct, in itself, has no way of enforcing modularity and a program might be structured as shown in Figure 12.3. That is, critical region statements performing operations on the shared data, may be dispersed through-out the program. Therefore, if one wanted to check how a particular piece of shared data is used, the programmer would have to go through the entire program to find all the critical regions related to that shared data.

Figure 12.3. Possible program structure with conditional critical regions.

A solution to this problem is to use a monitor, where a monitor has the structure of an abstract data object. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required