Example Bankers Algorithm for Multiple Resource Classes Operating Systems by

Example bankers algorithm for multiple resource

This preview shows page 29 - 39 out of 41 pages.

Example: Banker’s Algorithm for Multiple Resource Classes Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.29 Operating Systems, by Dhananjay Dhamdhere 29
Image of page 29
Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.30 Operating Systems, by Dhananjay Dhamdhere 30
Image of page 30
Characterization of Resource Deadlocks by Graph Models A deadlock characterization is a statement of the essential features of a deadlock We discuss characterization using graph models of allocation state and elements of graph theory A cycle in a RRAG or WFG is a sufficient condition for a Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.31 Operating Systems, by Dhananjay Dhamdhere 31 deadlock in some systems, but not in others
Image of page 31
Single-Instance, Single-Request (SISR) Systems Each resource class contains a single instance of the resource and each request is a single request A cycle in an RRAG implies a mutual wait-for relationship for a set of processes Since each resource class contains a single resource unit Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.32 Operating Systems, by Dhananjay Dhamdhere 32 Each blocked process P i in cycle waits for exactly one other process, say P k , to release required resource Hence a cycle that involves P i also involves P k A cycle is thus a necessary and sufficient condition to conclude that a deadlock exists in the system
Image of page 32
A knot in RRAG is a necessary and sufficient condition for the existence of a deadlock in an MISR system Multiple-Instance, Single-Request (MISR) Systems Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.33 Operating Systems, by Dhananjay Dhamdhere 33
Image of page 33
Single-Instance, Multiple-Request (SIMR) Systems A process making a multiple request has > 1 out-edge It remains blocked until each of the requested resources is available A cycle is a necessary and sufficient condition for a deadlock in an SIMR system Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.34 Operating Systems, by Dhananjay Dhamdhere 34
Image of page 34
Multiple-Instance, Multiple-Request (MIMR) Systems We must differentiate between process and resource nodes in the RRAG of an MIMR system All out-edges of a resource node must be involved in cycles for a deadlock to arise A process node needs to have only one out-edge Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.35 Operating Systems, by Dhananjay Dhamdhere 35 involved in a cycle A resource knot incorporates these conditions
Image of page 35
Multiple-Instance, Multiple-Request (MIMR) Systems (continued) A resource knot is a necessary and sufficient condition for the existence of a deadlock in an MIMR system... Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.36 Operating Systems, by Dhananjay Dhamdhere 36 And, in all classes of systems discussed in this section
Image of page 36
Processes in Deadlock Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.37 Operating Systems, by Dhananjay Dhamdhere 37
Image of page 37
Deadlock Handling in Practice Deadlock detection-and-resolution and deadlock avoidance are unattractive in practice (overhead) OS uses deadlock prevention approach or simply does not care about possibility of deadlocks OSs tend to handle deadlock issues separately for each Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.38 Operating Systems, by Dhananjay Dhamdhere 38
Image of page 38
Image of page 39

You've reached the end of your free preview.

Want to read all 41 pages?

  • One '20
  • Dhananjay Dhamdhere

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 You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes