Question 78
Explanation
Suppose a system has 12 magnetic tape drives and at time t0. three processes are allotted tape drives out of their need as given below:
At time t0, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?
Answer : 2. (P1, P0, P2 ) Process | Maximum Needs | Current Needs |
P0 | 10 | 5 |
P1 | 4 | 2 |
P2 | 9 | 2 |
At time t0, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?
Explanation
Out of Total 12 magnetic tape drives, 9 magnetic tape drives are allocated. So There are 3 remaining magnetic tape drives.
With available 3 magnetic tape drives, process P1 requirements of 2 magnetic tape drives can be fulfilled. So, after completion of process P1, it releases total 4 magnetic tape drives.
Now, with available tap drives are 4 + 1 = 5,
Process P0 requirements of 5 magnetic tape drives can only be fulfilled. So, after completion of process P0, it releases total 10 magnetic tape drives.
Now, available tap drives are 10,
Process P2 requirements of 9 magnetic tape drives can be fulfilled.
Process P2 will completed wihtout deadlock.
The only safe sequence that avoide deadlock is (P1, P0, P2). So, that system is in safe state for given process needs.
So, option 2 is correct answer
Process | Maximum Needs | Allocated resources | Remaining Needs |
P0 | 10 | 5 | 5 |
P1 | 4 | 2 | 2 |
P2 | 9 | 2 | 7 |
With available 3 magnetic tape drives, process P1 requirements of 2 magnetic tape drives can be fulfilled. So, after completion of process P1, it releases total 4 magnetic tape drives.
Now, with available tap drives are 4 + 1 = 5,
Process P0 requirements of 5 magnetic tape drives can only be fulfilled. So, after completion of process P0, it releases total 10 magnetic tape drives.
Now, available tap drives are 10,
Process P2 requirements of 9 magnetic tape drives can be fulfilled.
Process P2 will completed wihtout deadlock.
The only safe sequence that avoide deadlock is (P1, P0, P2). So, that system is in safe state for given process needs.
So, option 2 is correct answer
Previous | Next |
UGC NET CS December 2019 - Question 77 | UGC NET CS December 2019 - Question 79 |
Here answer d is also possible
ReplyDelete