|
|
|
View Full Essay |
|---|
CHAPTER
7
Process Synchronization
Learning Objectives
After reading this chapter, you should be able to: y Explain process synchronization and the need for it. y Describe some fundamental synchronization problems. y Discuss some useful synchronization tools. y Describe solutions to synchronization problems. y Explain deadlocks and their solutions.
7.1 Introduction
Processes in a computer system execute programs to manipulate data. One process may or may not interact with another process to accomplish its task, and as explained in Section 6.3.3 such interactions take place only through shared data. If two processes use two distinct sets of data items, then they are not considered interacting processes and their activities do not affect each other. Their behaviours are independent and do not influence each other. Whereas, if a process A modifies a data item that another process B reads, then the behaviour of B may depend on activities of A. Here we say the two processes are interacting with one another through shared data. The behaviour of these interacting processes then depend on two factors: the relative speeds of the processes, what they do with shared data and how they access the shared data. If the activities of interacting processes are not controlled suitably, their behaviour may not be as “consistent” as expected from their specifications. The theme of this chapter is the coordination of interacting processes, that is, the orderly execution of their accesses to shared data. Unlike interprocess communication (discussed in Chapter 6), process interaction is somewhat indirect. In many situations, a process may complete its own execution even if other processes are absent. Processes in general are independent, but they
A The operating system or any application execution may be considered to be a collection of processes in which some interact and some others do not. A Synchronization is the single most important topic in highly concurrent systems...