1 A computer has 8 tape drives with n processes competing fo
1. A computer has 8 tape drives, with n processes competing for them. Each process will need three drives. What is the largest possible value for n, and the system still remain deadlock free?
2. Use the deadlock detection algorithm in Section 6.4.2 of the textbook to answer this problem. Suppose you have two processes, P1 and P2, and below are there current allocation (C) and request matrices (R), along with resources in existence (E) and resources available (A) matrices.
Is there currently a deadlock condition between P1 and P2? Explain your answer.
| C = 0 2 0 1 | R = 1 2 0 2 | E = 1 3 2 2 | A = 0 1 1 1 |
| 1 0 1 0 | 1 1 1 1 |
Solution
1)
8 tape drives
Each process three drives
N = 2 we have two process and each process will use three drives each this means total we still have 2 drives free hence no deadlock
N = 3 we have three process and each process will use three drivers each this means we have this allocation 3,3,2 where though third process doesnot have full drives but it will not create deadlock as the any of first process will finish and release a drive.
N = 4, we have four process and each process will use three drivers each this means we need 12 drivers but have only 8 with us, something like 3,3,2,0 here two process will be waiting and could create a deadlock situtaion as no free drives
Hence with N<4 will no deadlock situation.
