Question

Consider a system with eight resources currently allocated as follows: Resource Allocated to Process R1 P4...

Consider a system with eight resources currently allocated as follows:

Resource Allocated to Process
R1 P4
R2 P1
R3 P5
R4 P7
R5 P2
R6 P8
R7 P3
R8 P6

The following sequence of additional resource requests is then processed. (Let REQ(A,B) denote process A's request for resource B.)

  • REQ(P4, R2)
  • REQ(P3, R6)
  • REQ(P2, R1)
  • REQ(P7, R7)
  • REQ(P6, R1)
  • REQ(P5, R7)

The above sequence of requests do not cause a deadlock. Verify this fact by constructing a resource-allocation graph involving R1 through R8 and P1 through P8.

For each of the following resource requests, add an arc to the resource-allocation graph and examine if the resource request causes a deadlock in the system. Identify the request, among the following, that does NOT cause a deadlock.

  • A. REQ(P1, R3)
  • B. REQ(P1, R8)
  • C. REQ(P1, R1)
  • D. REQ(P1, R5)

Homework Answers

Answer #1

The following is the pic for the Resource allocation graph for the already allocated resources to the process and also the requests.

R1,R2....R8 are the resources and P1,P2......P8 are the processes.

The already allocated resources to their respective processes are shown in red arrows. (the arrows are drawn from the allocated resource to the process)

The requests for resources by the processes are shown in black arrows( the arrow is drawn from the process to the resource) These are those requests

  • REQ(P4, R2)
  • REQ(P3, R6)
  • REQ(P2, R1)
  • REQ(P7, R7)
  • REQ(P6, R1)
  • REQ(P5, R7)

from the above Resource allocation graph, you can observe that P2 is waiting for P4 to release R1, P4 is waiting for P1 to release R2 and so on. we can represent these dependencies between the resources in the form of a graph.

The below picture is the dependencies between the processes of the above c.

If you observe, this dependencies graph does not have any cycles. It indicates there is no deadlocks.

coming to the 2nd part of the question. We first represent these requests in the resource allocation graph.

  • A. REQ(P1, R3)
  • B. REQ(P1, R8)
  • C. REQ(P1, R1)
  • D. REQ(P1, R5)

These requests are represented with pencil

A. REQ(P1, R3) ---> P1->P5 (NO cycle so No deadlock)

B.REQ(P1, R8) --> P1->P6->P4->P1 ( cycle is present, so deadloack is possible)

C. REQ(P1, R1) --> P1->P4->P1 ( cycle is present, so deadloack is possible)

D. REQ(P1, R5) --> P1->P2->P4->P1 ( cycle is present, so deadloack is possible)

So, only option A doesn't cause any deadlock

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What is deadlock? Draw a resource allocation graph for the following processes and resources. There are...
What is deadlock? Draw a resource allocation graph for the following processes and resources. There are four processes running (P1, P2, P3 and P4) and five resources each with single instance (R1, R2, R3, R4 and R5). P1 is holding R1 and R3 and requesting R2. P2 is holding R2 and requesting R3. P3 is holding R4 and requesting R5. P4 is holing R5 and requesting R1. Is it a deadlock situation? Justify your answer.
Deadlock Avoidance using Banker’s Algorithm Q1: Use the following information and complete the Table, also write...
Deadlock Avoidance using Banker’s Algorithm Q1: Use the following information and complete the Table, also write down the safe sequence if exist? Three Resources (R1=4, R2=9, R3=11) Processes Allocated Resources R1   R2    R3 Maximum Required Resources R1   R2    R3 Currently Available Resources R1   R2    R3 Remaining Need R1   R2    R3 Safe Sequence P1 1      4      2 2      4      6 P2 2      1      1 3      2      8 P3 0      0      1 1      2      3 P4 0      0      0 4      4      2
1. Over-applied overhead that is material in amount is allocated between Finished Goods inventory, Work in...
1. Over-applied overhead that is material in amount is allocated between Finished Goods inventory, Work in process Inventory and Cost of Goods sold at year end. Over-applied factory overhead that is immaterial in amount is closed to Cost of Goods Sold at year end. First and second sentence are true First and second sentence are false Only the first statement is true Only the second statement is true 2. Process costing is most appropriate when manufacturing large batches of homogeneous...