CS3224 - 7. Deadlocks (three per page)

CS3224 - 7. Deadlocks (three per page) - Deadlocks What are...

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

View Full Document Right Arrow Icon
1 Deadlocks • What are Deadlocks? • How do they occur? • How do we deal with them? What is a Deadlock? • Formal definition : 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 • Usually the event is release of a currently held resource • None of the processes can … –run – release resources – be awakened Resources • Examples of computer resources – printers – tape drives – tables, lists… • Processes need access to resources in reasonable order • Suppose a process holds resource A and requests resource B – at same time another process holds B and requests A – both are blocked
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 Resources • Deadlocks can occur when … – processes are granted exclusive access to resources • Preemptable resources – can be taken away from a process with no ill effects – therefore they don’t contribute to deadlock. • Nonpreemptable resources – will cause the process to fail if taken away Deadlock Modeling Resource Allocation Graph with a single instance of each resource. a) resource R assigned to process A b) process B is requesting/waiting for resource S c) process C and D are in deadlock over resources T and U How deadlock occurs A B C Deadlock Modeling
Background image of page 2
3 Deadlock Modeling How deadlock can be avoided (o) (p) (q) Resource-Allocation Graph with multiple instances of a resource •P r o c e s s Resource Type with 4 instances P i requests instance of R j P i is holding an instance of R j P i P i
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 Resource Allocation Graph
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/02/2010 for the course CS 3224 taught by Professor Johnsterling during the Spring '10 term at NYU Poly.

Page1 / 11

CS3224 - 7. Deadlocks (three per page) - Deadlocks What are...

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

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