Consider the following snapshot of a system. Which of the following is true? Allocation Max Available A…
Both I and II are true. The remaining needs are P1: (0, 0, 0, 0), P2: (0, 7, 5, 0), P3: (1, 0, 0, 2), P4: (0, 0, 2, 0) and P5: (0, 6, 4, 2). Starting with Available = (1, 5,…
Choose your answer
Consider the following snapshot of a system. Which of the following is true?
| Allocation | Max | Available | ||||||||||
| A | B | C | D | A | B | C | D | A | B | C | D | |
| P1 | 0 | 0 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 5 | 2 | 0 |
| P2 | 1 | 0 | 0 | 0 | 1 | 7 | 5 | 0 | ||||
| P3 | 1 | 3 | 5 | 4 | 2 | 3 | 5 | 6 | ||||
| P4 | 0 | 6 | 3 | 2 | 0 | 6 | 5 | 2 | ||||
| P5 | 0 | 0 | 1 | 4 | 0 | 6 | 5 | 6 | ||||
(I) The system is in a safe state.
(II) If a request from process P2 arrives for (0, 4, 2, 0), then the request can be granted.
Answer and explanation
Correct answer C
Both I and II are true. The remaining needs are P1: (0, 0, 0, 0), P2: (0, 7, 5, 0), P3: (1, 0, 0, 2), P4: (0, 0, 2, 0) and P5: (0, 6, 4, 2). Starting with Available = (1, 5, 2, 0), the sequence P1, P3, P4, P2, P5 is a safe sequence, so (I) holds. When P2 requests (0, 4, 2, 0), the request is within its need (0, 7, 5, 0) and within Available (1, 5, 2, 0); after tentative allocation, Available becomes (1, 1, 0, 0) and P2's remaining need becomes (0, 3, 3, 0), from which the same sequence P1, P3, P4, P2, P5 remains safe, so (II) also holds.
Practice for these exams
-
West Bengal SET (WB SET)