PART II CONCURRENCY CONTROL IN MAIN MEMORY
Chapter 9 System structure
Objectives
To show how processes can be used in systems. To motivate the need for various forms of interaction among processes. To introduce the potential problems when interactions take place. To define the concept of atomicity.
Points to emphasise
- Emphasise, by means of concrete examples, the need for multi-threaded servers in system design. Note that threads share writeable data.
- The need for processes in separate address spaces within a machine and on different machines.
- The need for interaction between threads of a process (using shared data) and between processes which do not share data.
- A number of different interaction patterns among processes might be required by software systems that are to make use of the IPC facility provided by an OS.
- If access to shared data by concurrent processes is not controlled, errors can occur.
- The concept of a single atomic, indivisible operation on an object. How do we achieve atomicity? (These last two points set up the detailed study in the next two chapters).
Possible difficulties
The limited experience of students might make these issues appear obscure rather than of central relevance to system design.
Teaching hints
- Give examples from the students’ experience wherever possible. Does their computing environment contain shared file servers? How many users are typically logged on at any time? How many are typically using a file server at any time? Recall the shared system tables in the file service implementation in Chapter 7.
- On process interactions: broadcasting a message that a system is about to go down could be used as an example. If a separate, acknowledged message was sent to everyone, the system might have crashed before the last user was notified.
- Discuss the operations on objects that the hardware makes atomic, e.g. read an integer, write an integer. Take simple examples of data structures and discuss their implementation as objects with interface operations. Analyse the number of hardware-atomic operations comprising each interface operation.
- It may be useful to spend a while at this stage looking at the difference between the multiprocessor execution of "book a seat" and the uniprocessor with pre-emption implementation Figure 8.7. It’s worth noting that the OS has no knowledge of the language level process state and the countdown of a process’s time is independent of what the process is doing. Note that reading or writing a given location in memory is atomic.