CS3224 - 6.Deadlocks.ppt

CS3224 - 6.Deadlocks.ppt - 4/19/10 Deadlocks What are...

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

View Full Document Right Arrow Icon
4/19/10 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
4/19/10 2 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 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
Background image of page 2
4/19/10 3 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 3

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

View Full DocumentRight Arrow Icon
4/19/10 4 Deadlock Modeling How deadlock can be avoided (o) (p) (q) Resource-Allocation Graph with multiple instances of a resource Process Resource Type with 4 instances P requests instance of R P is holding an instance of R P P R R
Background image of page 4
4/19/10 5 Resource Allocation Graph Resource Allocation Graph
Background image of page 5

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

View Full DocumentRight Arrow Icon
4/19/10 6 Resource Allocation Graph
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

CS3224 - 6.Deadlocks.ppt - 4/19/10 Deadlocks What are...

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

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