CS 1550 Lecture Notes - Lecture 4: Mutual Exclusion, Spooling, Two-Phase Locking

38 views3 pages
21 Feb 2017
School
Course
Deadlocks
Definition: each process in the set is waiting for an event that only another process in
the set can cause
Conditions for Deadlock (all must occur):
Mutual Exclusion: resource can only be held by one process at a time
o Ex: printer (can't be shared simultaneous), critical region, cd drive
Hold and wait: process gains one resource, holds it, then attempts to gain
another, waiting if failed
o Since you cant share the resource (mutual exclusion) and can't take it
from someone else (no preemption), you have to wait for the resource
No preemption: Resource cannot be forcibly taken away
o Referring to preempting a specific resource (property of the resources
themselves)
Ex: printer (can't preempt a printer while its printing)
Circular wait: Process A is waiting for a resource held by Process B which is
waiting for a resource in Process A
o Process holding something waiting for something else, the thing the
process is waiting for is being held. Infinite
Dealing with Deadlock
Ignore
o Ostrich Algorithm: pretend like it didn't happen (stick our head in the sand)
Detect and recover
o Detection
Need list of process and list of resources
Need to know when a process need/want
Know this through open system call and blocking
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Definition: each process in the set is waiting for an event that only another process in the set can cause. Mutual exclusion: resource can only be held by one process at a time: ex: printer (can"t be shared simultaneous), critical region, cd drive. No preemption: resource cannot be forcibly taken away: referring to preempting a specific resource (property of the resources themselves) Ex: printer (can"t preempt a printer while its printing) Ignore: ostrich algorithm: pretend like it didn"t happen (stick our head in the sand) Need list of process and list of resources. Need to know when a process need/want. Know this through open system call and blocking. Use depth-first search with marking to determine if there"s a cycle. When to run algorithm: give the algorithm a low priority, then you don"t need a specific threshold of when to run it: recover. Not everything, you could end up with the same problem.

Get access

Grade+20% OFF
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers