lecture 13 -- deadlock pre-emptable and non-pre-emptable resource (e.g., memory and a process can be paged out; but once a CDR has started burning, it cannot) pg 163 code demo: order of requesting resources matters! def'n of deadlock: a set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause. 4 conditions of deadlock: 1. mutual exclusion -- each resource is either assigned to a proc or is available 2. hold and wait -- processes current holding resources granted earlier can request new resources 3. no preemption -- procs must release 4. circular wait -- there must be a chain of 2+ procs waiting on another. deadlock modeling pg 165 resource allocation graphs 4 strategies for dealing w/deadlock 1. "ostrich algorithm" (not necessarily bad from an engineering standpoint) 2. detection and recovery (preemption, rollback, kill) 3. dynamic avoidance by careful resource allocation 4. prevention, by structurally negating one of the 4 conditions necessary to cause deadlock