1 / 12

Representation of System Model with Resource-Allocation Graph

DEADLOCK Date- 12/3/14 By Manoj Kumar (11CS10055). Representation of System Model with Resource-Allocation Graph. A set of edges E and A set of vertices V V is partitioned into two types:

jerom
Download Presentation

Representation of System Model with Resource-Allocation Graph

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEADLOCKDate- 12/3/14 By Manoj Kumar (11CS10055)

  2. Representation of System Model with Resource-Allocation Graph • A set of edges E and A set of vertices V • V is partitioned into two types: • P = {P1, P2, …, Pn}, the set consisting of all the processes in the system. • R = {R1, R2, …, Rm}, the set consisting of all resource types in the system. • request edge – directed edge P1  Rj • assignment edge – directed edge Rj Pi

  3. Process • Resource Type with 4 instances • Pirequests instance of Rj • Pi is holding an instance of Rj

  4. Example of Resource Allocation Graph

  5. Example of Resource Allocation Graph with Deadlock

  6. Example of Resource Allocation Graph with Cycle but no Deadlock

  7. If a Resource Allocation Graph does not have a cycle System is not in Deadlock state • If there is a cycle May or may not be in a deadlock state

  8. DEADLOCK HANDLING DEADLOCK DETECTION AND RECOVERY : Let Deadlocks occur, detect them and take action. DEADLOCK AVOIDANCE : By Careful Resource Allocationavoiding Deadlock DEADLOCK PREVENTION: By Structurally negating one of the four Required conditions. Just ignore the problem

  9. DEALOCK DETECTION - Allow system to enter Deadlock State - Detection Algorithm - Recovery Scheme

  10. Single Instance of each Resource Type • Maintain wait-for graph • Nodes are processes. • Pi Pjif Piis waiting forPj. • Periodically invoke an algorithm that searches for a cycle in the graph. If there is cycle there exists Deadlock. • An algorithm to detect a cycle in a graph requires an order of n2 operations, where n is the number of vertices in the graph.

  11. Resource Allocation and Wait-for Graphs

  12. Several Instances of a Resource Type • Available: A vector of length m indicates the number of available resources of each type. • Allocation: An n x m matrix defines the number of resources of each type currently allocated to each process. • Request: An n x m matrix indicates the current request of each process. If Request [ij] = k, then process Pi is requesting k more instances of resource type Rj.

More Related