Question: If a request from process P1 arrives for (2,0,0), Can the system grant this if it wants to avoid deadlock? Explain. Consider the following snapshot

If a request from process P1 arrives for (2,0,0), Can the system grant this if it wants to avoid deadlock? Explain.  If a request from process P1 arrives for (2,0,0), Can the

Consider the following snapshot of a system with resouces: A, B, Cand processes: Po, Pi Allocation Total Max A B C A B C 12 9 12 Po 2 1 3 4 9 4 1 2 3 2 1 2 Answer questions using the banker's algorithm. Here is the "safety" and "resource-request" algorithm for process i 1. Let Work and Finish be vectors of length m and n, respectively. Initialize Work Available Finish false for 0, 1, n-1 2. Find and i such that both (a) Finish false (b) Need, Work If no such i exists, go to step 4. 3. Work Work Allocation Finish true 4. go to step 2 in safe state If Finish ril true for all i, then the svstem is a Request request vector for process Pi k instances of resource type R If Request k then process P wants 1. If Request s Needi go to step 2. process has exceeded its Otherwise, raise error condition, since maximum claim 2. If Request, Available, go to step 3 are not available Otherwise P must wait, since resources state 3. Pretend to allocate requested resources to P by modifying the as follows: Available Available Request, Allocationi- Allocationi Request, Need, E Need, Request lf safe the resources are allocated to Pi state If unsafe Pi must wait, and the old resource-allocation is restored

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!