Presentation is loading. Please wait.

Presentation is loading. Please wait.

Resource Allocation Graphs

Similar presentations


Presentation on theme: "Resource Allocation Graphs"— Presentation transcript:

1 Resource Allocation Graphs
Lecture 4 Introduction to Resource Allocation Graphs

2 Resource-Allocation Graphs
Squares Represent processes Large circles Represent classes of identical resources Small circles drawn inside large circles Indicate separate identical resources of each class

3 Resource-Allocation Graphs
Resource-allocation and request graphs.

4 Reduction of Resource-Allocation Graphs
Graph reductions If a process’s resource requests may be granted, the graph may be reduced by that process If a graph can be reduced by all its processes, there is no deadlock If a graph cannot be reduced by all its processes, the irreducible processes constitute the set of deadlocked processes in the graph

5 Reduction of Resource-Allocation Graphs
Graph reductions determining that no deadlock exists.

6 Resource Allocation Graphs and Deadlock Prevention
We have learned that resource alloction graphs can be used to detect deadlock in a set of processes in contention for shared resources by simplifying the graph and then searching for irreducible cycles.  In this exercise we will investigate a procedure for preventing deadlock by setting limits on the number of resources of each type that can be requested by a process and then providing a sufficient total number of resources evenly distributed across the resource types. We want to know the minimum number of resources required to prevent deadlock for a given number of processes and resource types.  Our goal is to devise a mathematical formula to compute this minimal number.  To prepare for this task, answer the following questions about the resource allocation graphs provided.

7 Is a condition of deadlock exhibited in this resource allocation graph?

8 Is a condition of deadlock exhibited in this resource allocation graph?

9 Is a condition of deadlock exhibited in this resource allocation graph?

10 Given P processes, and R resource types, and assuming that each process can request at most m of each type of resource, find an expression for N(P,R,m) that computes the minimum total number of resources evenly distributed over the R resource types that will prevent deadlock.                  N(P,R,m) = Note:  For resources to be "evenly distributed" over the R resource types means that no resource type may have more than 1 more resource that any other resource type.  For example, given R=3 and N = 8 we could allocate resources in any of the following ways, while the following are not "evenly distributed".


Download ppt "Resource Allocation Graphs"

Similar presentations


Ads by Google