Chapter05-OS7e - Chapter 5 Concurrency: Mutual Exclusion...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles Seventh Edition By William Stallings Designing correct routines for controlling concurrent activities proved to be one of the most difficult aspects of systems programming. The ad hoc techniques used by programmers of early multiprogramming and real-time systems were always vulnerable to subtle programming errors whose effects could be observed only when certain relatively rare sequences of actions occurred. The errors are particularly difficult to locate, since the precise conditions under which they appear are very hard to reproduce. THE COMPUTER SCIENCE AND ENGINEERING RESEARCH STUDY , MIT Press, 1980 Operating System design is concerned with the management of processes and threads: Multiprogramming Multiprocessing Distributed Processing Concurrency Table 5.1 Some Key Terms Related to Concurrency Interleaving and overlapping can be viewed as examples of concurrent processing both present the same problems In multiprogramming, the relative speed of execution of processes cannot be predicted depends on activities of other processes the way the OS handles interrupts scheduling policies of the OS Difficulties of Concurrency Difficulties of Concurrency Sharing of global resources Difficult for the OS to manage the allocation of resources optimally Difficult to locate programming errors as results are not deterministic and reproducible Occurs when multiple processes or threads read and write shared data items The final result depends on the order of execution the loser of the race is the process that updates last and will determine the final value of the variable Operating System Concerns Operating System Concerns Design and management issues raised by the existence of concurrency: The OS must: be able to keep track of various processes allocate and de-allocate resources for each active process protect the data and physical resources of each process against interference by other processes ensure that the processes and outputs are independent of the processing speed P I R N O T C E E R S A S C T I O N 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 Need for Mutual Exclusion If there is no controlled access to shared data, processes or threads may get an inconsistent view...
View Full Document

This note was uploaded on 12/14/2011 for the course CS 490 taught by Professor Weisskop during the Fall '11 term at University of Alabama - Huntsville.

Page1 / 72

Chapter05-OS7e - Chapter 5 Concurrency: Mutual Exclusion...

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