Operating Systems · Question 27 · Hard
Operating Systems question 27
A system has three resource types. Available = (1, 2, 2).
Process | Allocation | Max
P1 | 1 0 2 | 4 2 3
P2 | 2 1 0 | 3 2 2
P3 | 0 1 1 | 2 3 4
P4 | 1 1 0 | 1 3 1
Using the Banker's algorithm, which of the following is a safe sequence?
- P1, P2, P3, P4
- P4, P2, P1, P3
- P4, P3, P2, P1
- P4, P1, P2, P3
Answer and explanation
Answer: B. P4, P2, P1, P3
Explanation: Need = Max - Allocation: P1 (3,2,1), P2 (1,1,2), P3 (2,2,3), P4 (0,2,1). P4 fits in (1,2,2) and returns resources to give (2,3,2); P2 then fits, giving (4,4,2); P1 fits, giving (5,4,4); P3 fits. The other orders fail at their first or second step.
Previous: Process (arrival time, burst time, priority) in ms: P1 (0, 5, 3), P2 (1, 3… · Next: Memory access time is 200 ns, and servicing a page fault takes 8 ms. If 1 in…
Practise operating systems
Try a fresh set of operating systems questions with an explanation after every answer, free and without signing up: Operating Systems practice. Or sit a full placement mock test.
More operating systems questions
- A disk has cylinders 0 to 199 and the head is at cylinder 50. The request…
- A system uses 32-bit logical addresses, a page size of 4 KB and 4-byte…
- Process (arrival time, burst time, priority) in ms: P1 (0, 5, 3), P2 (1, 3…
- Memory access time is 200 ns, and servicing a page fault takes 8 ms. If 1 in…
- Three processes share identical units of one resource, and each process may…
- A disk has cylinders 0 to 199 and the head is at cylinder 50, moving towards…
More technical & programming practice
Computer Networks · Software Engineering · Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java · Python
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge