11.Deadlock - Deadlock 1 Concurrency Issues Past lectures:...

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

View Full Document Right Arrow Icon
1 Deadlock
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Concurrency Issues Past lectures: Problem: Safely coordinate access to shared resource Solutions: Use semaphores, monitors, locks, condition variables Coordinate access within shared objects What about coordinated access across multiple objects? If you are not careful, it can lead to deadlock Today’s lecture: What is deadlock? How can we address deadlock?
Background image of page 2
3 Deadlocks Motivating Examples Two producer processes share a buffer but use a different protocol for accessing the buffers A postscript interpreter and a visualization program compete for memory frames Producer1() {   P(emptyBuffer)   P(producerMutexLock)    : } Producer1() {   P(emptyBuffer)   P(producerMutexLock)    : } Producer2(){   P(producerMutexLock)   P(emptyBuffer)    : } Producer2(){   P(producerMutexLock)   P(emptyBuffer)    : } PS_Interpreter() {   request(memory_frames, 10)   <process file>   request(frame_buffer, 1)   <draw file on screen> } PS_Interpreter() {   request(memory_frames, 10)   <process file>   request(frame_buffer, 1)   <draw file on screen> } Visualize() {   request(frame_buffer, 1)   <display data>   request(memory_frames, 20)   <update display> } Visualize() {   request(frame_buffer, 1)   <display data>   request(memory_frames, 20)   <update display> }
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 The TENEX Case If a process requests all systems buffers, operator console tries to print an error message To do so lock the console request a buffer DUH!
Background image of page 4
5 Deadlock Definition A set of processes is deadlocked when every process in the set is waiting for an event that can only be generated by some process in the set Starvation vs. deadlock Starvation: threads wait indefinitely (e.g., because some other thread is
Background image of page 5

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

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

This document was uploaded on 03/09/2012.

Page1 / 15

11.Deadlock - Deadlock 1 Concurrency Issues Past lectures:...

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

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