Chapter05-OS7e - nOperatin g Systems: Internals and Design...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5 Concurrency:  Mutual Exclusion  and  n Operatin Systems: Internals  and  Design  Principle s Seventh Edition By William Stallings
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operating Systems: Internals and Design Principles    “ Designing correct routines
Background image of page 2
Multiple  Processes n Operating System design is concerned  with the management of processes and  threads: n Multiprogramming n Multiprocessing n Distributed Processing
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Concurrency Arises in Three Different Contexts :              
Background image of page 4
Key                 Term s Concurrency Table 5.1   Some Key Terms Related to Concurrency
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Principles of Concurrency n Interleaving and overlapping  n can be viewed as examples of concurrent processing n both present the same problems n In multiprogramming, the relative speed of  execution of processes cannot be predicted n depends on activities of other processes n the way the OS handles interrupts n scheduling policies of the OS
Background image of page 6
Difficulties of Concurrency n Sharing of global resources n Difficult for the OS to manage the allocation  of resources optimally n Difficult to locate programming errors as  results are not deterministic and reproducible
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Race Condition n Occurs when multiple processes or  threads read and write shared data items n The final result depends on the order of  execution n the “loser” of the race is the process that  updates last and will determine the final  value of the variable
Background image of page 8
Operating System Concerns n Design and management issues raised by the existence of  concurrency: n The OS must:  n be able to keep track of various processes n allocate and de-allocate resources for each              active  process n protect the data and physical resources of each process  against interference by other processes n ensure that the processes and outputs are independent of  the processing speed
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
P     I R    N  O    T C    E E    R S    A S    C       T        I       O       N
Background image of page 10
Resource Competition § Concurrent processes come into conflict when  they use the same resource (competitively or  shared) §  for example: I/O devices, memory, processor time, clock § Three control problems must be faced § Need for mutual exclusion § Deadlock § Starvation § Sharing processes also need to address  coherence
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
n If there is no controlled access to shared data,  processes or threads may get an inconsistent view  of this data n The result of concurrent execution will depend on  the order in which instructions are interleaved. n
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 70

Chapter05-OS7e - nOperatin g Systems: Internals and Design...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online