Chapter 6 - M06_STAL6329_06_SE_C06.QXD 4:00 AM Page 262...

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

View Full Document Right Arrow Icon
C ONCURRENCY :D EADLOCK AND S TARVATION 6.1 Principles of Deadlock Reusable Resources Consumable Resources Resource Allocation Graphs The Conditions for Deadlock 6.2 Deadlock Prevention Mutual Exclusion Hold and Wait No Preemption Circular Wait 6.3 Deadlock Avoidance Process Initiation Denial Resource Allocation Denial 6.4 Deadlock Detection Deadlock Detection Algorithm Recovery 6.5 An Integrated Deadlock Strategy 6.6 Dining Philosophers Problem Solution Using Semaphores Solution Using a Monitor 6.7 UNIX Concurrency Mechanisms Pipes Messages Shared Memory Semaphores Signals 6.8 Linux Kernel Concurrency Mechanisms Atomic Operations Spinlocks Semaphores Barriers 6.9 Solaris Thread Synchronization Primitives Mutual Exclusion Lock Semaphores Readers/Writer Lock Condition Variables 6.10 Windows Concurrency Mechanisms Wait Functions Dispatcher Objects Critical Sections Slim Read-Writer Locks and Condition Variables 6.11 Summary 6.12 Recommended Reading 6.13 Key Terms, Review Questions, and Problems 262 CHAPTER M06_STAL6329_06_SE_C06.QXD 2/28/08 4:00 AM Page 262
Background image of page 1

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

View Full DocumentRight Arrow Icon
6.1 / PRINCIPLES OF DEADLOCK 263 This chapter continues our survey of concurrency by looking at two problems that plague all efforts to support concurrent processing: deadlock and starvation.We begin with a discussion of the underlying principles of deadlock and the related problem of starvation. Then we examine the three common approaches to dealing with deadlock: prevention, detection, and avoidance.We then look at one of the classic problems used to illustrate both synchronization and deadlock issues:the dining philosophers problem. As with Chapter 5, the discussion in this chapter is limited to a consideration of concurrency and deadlock on a single system. Measures to deal with distributed dead- lock problems are assessed in Chapter 18. 6.1 PRINCIPLES OF DEADLOCK Deadlock can be defined as the permanent blocking of a set of processes that either compete for system resources or communicate with each other.A set of processes is deadlocked when each process in the set is blocked awaiting an event (typically the freeing up of some requested resource) that can only be triggered by another blocked process in the set. Deadlock is permanent because none of the events is ever triggered. Unlike other problems in concurrent process management, there is no efficient solution in the general case. All deadlocks involve conflicting needs for resources by two or more processes. A common example is the traffic deadlock. Figure 6.1a shows a situation in which four cars have arrived at a four-way stop intersection at approximately the same time. The four quadrants of the intersection are the resources over which control is needed. In particular, if all four cars wish to go straight through the intersection, the resource requirements are as follows: Car 1, traveling north, needs quadrants a and b.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2010 for the course EXTC 56 taught by Professor Stalling during the Spring '10 term at Abu Dhabi University.

Page1 / 47

Chapter 6 - M06_STAL6329_06_SE_C06.QXD 4:00 AM Page 262...

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

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