5.1.3 Operating System Concerns(1/1) Design and management issues raised by the existence of concurrency The os must be able to keep track of various processes allocate and deallocate resources · Processor time · Memory Files ·I/ o devices protect data and resources ensure processes and outputs are independent of the processing speed
5.1.3 Operating System Concerns(1/1) • Design and management issues raised by the existence of concurrency • The OS must: • be able to keep track of various processes • allocate and deallocate resources • Processor time • Memory • Files • I/O devices • protect data and resources • ensure processes and outputs are independent of the processing speed 17
5.1 Principles of concurrent 5.1.0 What is concurrency .5.1.1 A Simple example ·5.1.2 Race condition 5.1.3 Operating System Concerns 5.1, 4 Process Interaction 5.1.5 Requirements for Mutual Exclusion
5.1 Principles of Concurrency • 5.1.0 What is concurrency • 5.1.1 A Simple Example • 5.1.2 Race Condition • 5.1.3 Operating System Concerns • 5.1.4 Process Interaction • 5.1.5 Requirements for Mutual Exclusion 18
5.1. 4 Process Interaction (1/5) ·进程间三种可能的交互方式 Processes unaware of each other Processes indirectly aware of each other Process directly aware of each other
19 5.1.4 Process Interaction(1/5) • 进程间三种可能的交互方式 • Processes unaware of each other • Processes indirectly aware of each other • Process directly aware of each other
5.1. 4 Process Interaction(2/ 5) Table s2 Process Interaction Degree of Awareness Relationship Influence that one Potential Control Process has on the Problems Other Processes unaware of Competition Results of one Mutual exclusion each other process independent of the action of others .Deadlock (renewable resource) -Timing of process may be affected Starvation Processes indirectly Cooperation by Results of one Mutual exclusion aware of each other sharin process may depend Ce.g, shared ob ject) on information obtained from others .Deadlock (renewable resource) Timing of process may be affected Starvation .Data coherence Processes directly Cooperation by Results of one .Deadlock aware of each other communication process may depend (consumable Chave communication on information resource) primitives available to obtained from others them) Starvation Timing of process may be affected
5.1.4 Process Interaction(2/5) 20
5.1. 4 Process Interaction (3/5) Resource competition Concurrent processes come into confict when they are competing for use of the same resource for example: I/o device, memory, processor time In the case of competing processes three control problem must be faced the need for mutual exclusion deadlock starvation 21
21 5.1.4 Process Interaction(3/5) • Resource Competition • Concurrent processes come into confict when they are competing for use of the same resource • for example: I/O device, memory, processor time • In the case of competing processes three control problem must be faced: • the need for mutual exclusion • deadlock • starvation