Modified ch7.ppt - Chapter 7 Deadlocks Operating System Concepts – 9th Edition Silberschatz Galvin and Gagne ©2013 Chapter 7 Deadlocks System Model

Modified ch7.ppt - Chapter 7 Deadlocks Operating System...

This preview shows page 1 - 9 out of 47 pages.

Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks
Image of page 1

Subscribe to view the full document.

7.2 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock
Image of page 2
7.3 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To present a number of different methods for preventing or avoiding deadlocks in a computer system
Image of page 3

Subscribe to view the full document.

7.4 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set Example System has 2 disk drives P 1 and P 2 each hold one disk drive and each needs another one Example semaphores A and B , initialized to 1 P 0 P 1 wait (A); wait(B) wait (B); wait(A)
Image of page 4
7.5 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Bridge Crossing Example Traffic only in one direction Each section of a bridge can be viewed as a resource If a deadlock occurs, it can be resolved if one car backs up (preempt resources and rollback) Several cars may have to be backed up if a deadlock occurs Starvation is possible Note – Most OSes do not prevent or deal with deadlocks
Image of page 5

Subscribe to view the full document.

7.6 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition System Model System consists of resources Resource types R 1 , R 2 , . . ., R m CPU cycles, memory space, I/O devices Each resource type R i has W i instances. Each process utilizes a resource as follows: request use release
Image of page 6
7.7 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Deadlock Characterization Mutual exclusion : only one process at a time can use a resource Hold and wait : a process holding at least one resource is waiting to acquire additional resources held by other processes No preemption : a resource can be released only voluntarily by the process holding it, after that process has completed its task Circular wait : there exists a set { P 0 , P 1 , …, P n } of waiting processes such that P 0 is waiting for a resource that is held by P 1 , P 1 is waiting for a resource that is held by P 2 , …, P n –1 is waiting for a resource that is held by P n , and P n is waiting for a resource that is held by P 0 . Deadlock can arise if four conditions hold simultaneously.
Image of page 7

Subscribe to view the full document.

7.8 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Deadlock with Mutex Locks Deadlocks can occur via system calls, locking, etc.
Image of page 8
Image of page 9
  • Spring '13
  • JAY HEIZER | BARRY RENDER | CHUCK MUNSON

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes