Example Bankers Algorithm for Multiple Resource Classes Operating Systems by

# Example bankers algorithm for multiple resource

• edwardtoo165
• 41

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
Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.30 Operating Systems, by Dhananjay Dhamdhere 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
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
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
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
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
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
Processes in Deadlock Operating Systems, by Dhananjay Dhamdhere Copyright © 2008 8.37 Operating Systems, by Dhananjay Dhamdhere 37

#### You've reached the end of your free preview.

Want to read all 41 pages?

• One '20
• Dhananjay Dhamdhere

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern