Question

In order to prevent deadlocks, let a system adopt the policy of forcing processes to request...

In order to prevent deadlocks, let a system adopt the policy of forcing processes to request resources in ascending order of request type rank. In particular, when a process is requesting a resource of a certain type, the process cannot be holding other higher ranked resources.

Consider four resource types with the following profile in this system:

Resource Type Rank Number of Instances
RT1 4 2
RT2 7 4
RT3 8 3
RT4 10 2

Let the following sequence of resource requests be processed by the system (note that REQ(A, B, k) represents the request of k resources of type B by process A and REL(A, B, k) represents process A releasing k resources of type B):

  • REQ(P4, RT2, 3)
  • REQ(P3, RT3, 2)
  • REQ(P2, RT4, 1)
  • REL(P4, RT2, 3)
  • REQ(P4, RT1, 2)
  • REL(P2, RT4, 1)
  • REL(P3, RT3, 2)
  • REQ(P3, RT2, 3)
  • REQ(P2, RT3, 2)
  • REQ(P1, RT4, 2)

Note that all of the above request and release operations can be processed without any violation of the deadlock-prevention policy of the system.

For each of the following sequences of request/release operations, examine if it can or cannot be processed without violating the deadlock-prevention scheme above. Identify the sequence that is allowed by the scheme and consequently can be processed without leading to system deadlock?

  • A. REL(P2, RT3, 2), REQ(P4, RT4, 2), REQ(P2, RT4, 2), REQ(P1, RT1, 2)
  • B. REQ(P2, RT4, 2), REL(P1, RT4, 2), REQ(P4, RT4, 2), REQ(P1, RT1, 2)
  • C. REL(P2, RT3, 2), REQ(P3, RT4, 2), REQ(P2, RT1, 2), REQ(P1, RT2, 2)
  • D. REL(P3, RT2, 3), REQ(P2, RT4, 2), REQ(P4, RT2, 2), REQ(P1, RT3, 2)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ven- Resource Rank No. of Instances RT1 RT 2 It RT3 8 . 2- . RT4 T 10 Processing Given Roquests first REQ(P4, RT2,3): Allocatnow, JRT RT RT RTul . 6. REL(P2, RT4; 1): Pa releases I instance of Rty allocated to it Prough | RT_RTI R 7. RELCP3, RT3 12)After completion of given request release operations, we have Available :- Resource Rank No of Instances RT RT2 77 1 RT 2 1 813. REO (P2, R14, 2)2- P₂ holding RP3 & requesting RTY Rank (RT2)s Rank(Rty). not violating guli cam allocate: But RTy res hNOW, TRT1 RT RT3 RTY 0110 Po Holding RT3 (2. instances) P2 Pg » RT2 (3 instances) py → RTI (2 Pnstances); RTU (ZPnstances). 4O REL(P2, RT3,2?, RES(PIRTY, 2), REB (PZ/RT13), REES (P1, RT3139:- I CI REL(P2, RT312) : : Po releases a instances of RT3. NoD) RELCP3, RT2;3), REB (P2, RT412) REQ (PY, R 12,2), REQ (P4, RT3,2). 1. REL(P3, RT2,3)=- Ps releases 3. instances of RT2: .

Add a comment
Know the answer?
Add Answer to:
In order to prevent deadlocks, let a system adopt the policy of forcing processes to request...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please give an explanation for the answers as well. 1. A system has three processes (P1,...

    Please give an explanation for the answers as well. 1. A system has three processes (P1, P2, and P3) and three resources (R1, R2, and R3). There is one instance of RI, two instances of R2, and three instances of R3. PI holds RI and one instance of R3 and is requesting one instance from R2. P2 holds one instance of R3 and is requesting RI and one instance from R2. P3 holds two instances of R2 and one instance...

  • a. A system has two processes and three identical resources. Each process needs a maximum of...

    a. A system has two processes and three identical resources. Each process needs a maximum of two resources. Is deadlock possible? Explain your answer. b. A system has 4 processes, P1 through P4, and 5 types of resources, R1 through R5. Existing resource vector E = (3, 2, 1, 2, 2) Current allocation matrix C = R1 R2 R3 R4 R5 P1 1 1 0 0 0 P2 0 0 1 0 0 P2 1 0 0 20 P4 0...

  • Given the table, suppose we have avoided circular-wait by ordering the resources in the order R1...

    Given the table, suppose we have avoided circular-wait by ordering the resources in the order R1 -> R2 -> R3 -> R4 and enforcing that each process must request resources in the ascending order. Show one allocation possibility of R1-R4 to P1-P4 and the corresponding wait-for graph. If there is a deadlock, please explain why or why not? Resource No. of instances Requested Allocated R1 2 P1, P2 ? R2 1 P1, P3 ? R3 1 P3, P4 ? R4...

  • In a computer system five processes are attempting to proceed with three resource types. The total...

    In a computer system five processes are attempting to proceed with three resource types. The total units of system resources are: (8,9,7). The maximum demands for every process are: P1(3,1,1), P2(3,3,2), P3(5,3,2), P4(5,1,2), P5(8,4,3). The current allocation is: P1 (0,1,1), P2 (2,1,1), P3 (3,1,2), P4 (1,1,1), and P5 (2,3,2). Is this state a safe state? Explain

  • A system has five processes P1 through P5 and four resource types R1 through R4. There...

    A system has five processes P1 through P5 and four resource types R1 through R4. There are 2 units of each resource type. Given that: P1 holds 1 unit of R1 and requests 1 unit of R4 P2 holds 1 unit of R3 and requests 1 unit of R2 P3 holds one unit of R2 and requests 1 unit of R3 P4 requests 1 unit of R4 P5 holds one unit of R3 and 1 unit of R2, and requests...

  • Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for...

    Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for example, IWWS represents the sequence of calls init(s), wait(s), wait(s), and signal(s) by some processes in an operating system. For each of the following sequences of calls, state the value of s and the number of processes blocked after the last call in the sequence: (b) IS (c) ISSSW (d) IWWWS (e) ISWWWW Each of the following code fragments contains a bug in the...

  • In the code below, three processes are competing for six resources labeled A to F. a....

    In the code below, three processes are competing for six resources labeled A to F. a. Determine a sequence of requests and locks that results in a deadlock among the 3 processes. You could, for example, for each process list which resources it currently has locked (Allocated) and which resource it is requesting. Hint: it might be useful to draw a resource allocation graph to help you find a deadlock. b. Modify the order of some of the get requests...

  • resource instances of the same type, being shared by processes maz, is maximum resource needs of...

    resource instances of the same type, being shared by processes maz, is maximum resource needs of Pi, where 2 mar, S m n. Assume that a process can request one resource at a time during execution. Answer 7. (20 pts) Consider a system of m P, P Pa where m 22. Suppose the following questions about deadlock among the various processes A: Suppose m 5 printers and n 2 processes in a system, with mazi 3 and mar2 4. Identify...

  • Assume in a system, there are: - 3 processes P1 to P3; - 3 resource types:...

    Assume in a system, there are: - 3 processes P1 to P3; - 3 resource types: A(9 instances), B(5 instances), and C(5 instances). Below is a snapshot at time T: 1) Show that the system is in a safe state at time T. 2) Can request for (A: 2, B: 0, C: 0) by P1 be granted? Explain your answer. Thank you so much, and it would be much better if it is well written and explained. Allocation Max Pl...

  • Answer the following question: Allocation Available A B C D 3 3 2 1 Ро P1...

    Answer the following question: Allocation Available A B C D 3 3 2 1 Ро P1 A B C D 2001 3121 2103 1312 1 432 Max ABCD 4212 5252 2316 1424 36 65 P2 P3 P4 The snapshot of a system 1) Illustrate that the system is in a safe state by demonstrating an order in which the processes may complete. (Format: use process number only, e.g. 01234) 2) If a request from process P1 arrives for (1,1,0,0), can...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT