v6stanford.edu-Deadlock - Deadlock http:/w w w

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

View Full Document Right Arrow Icon
http://w w w .stanford.edu/~ouster/cgi-bin/cs140-w inter12/lecture.php?topic=deadlock January 11, 2012 Deadlock Deadlock Lecture Notes for CS 140 Winter 2012 John Ousterhout Readings for this topic from Operating System Concepts : Sections 7.1-7.4. The deadlock problem: Threads often need to hold multiple locks at the same time. Simple example: Thread A Thread B lock_acquire(l1); lock_acquire(l2); lock_acquire(l2); lock_acquire(l1); ... . .. lock_release(l2); lock_release(l1); lock_release(l1); lock_release(l2); Deadlock definition: A collection of threads are all blocked. Each thread is waiting for a resource owned by one of the other threads. Since all threads are blocked, none can release their resources. Four conditions for deadlock: Limited access: resources cannot be shared. No preemption. Once given, a resource cannot be taken away. Multiple independent requests: processes don't ask for resources all at once (hold
Background image of page 1

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

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

This note was uploaded on 04/02/2012 for the course CS 140 taught by Professor Rosenblum during the Winter '08 term at Stanford.

Page1 / 2

v6stanford.edu-Deadlock - Deadlock http:/w w w

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

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