CPSC 3220 - DAY 12 OCTOBER 12, 2017 ================================================================================ Deadlocks --------- Resource: a physical or virutal entity that can be assigned to a user or application. -Anything needed by a thread to do its job (CPU, disk space, memory, lock) -Preemptable: can be taken away by OS -Non-preemptable: must leave with thread Starvation: thread waits indefinitely Deadlock: circular waiting for resources -Deadkock => starvation. Necessary Conditions for Deadlock --------------------------------- Limited access to resources -If infinite resources, no deadlock! No preemption -If resources are virtual, can break deadlock Multiple independend requests -wait while holding Circular chain of requests