CS FundamentalsVery hardGATE CS (PYQ pattern)
Deadlock detection (multiple instances of 3 resource types) with 6 processes. Allocation: P0 (2,0,2), P1 (1,2,1), P2 (1,0,1), P3 (1,0,0), P4 (1,1,1), P5 (2,2,2). Current Request: P0 (1,0,2), P1 (0,2,2), P2 (1,0,1), P3 (0,0,2), P4 (2,2,1), P5 (2,2,1). Available = (1,1,1). Which processes are deadlocked?
- A. P0, P2, P3
- B. P1, P4, P5, P2
- C. P1, P4, P5
- D. P1, P4
Correct answer: C. P1, P4, P5
Run the detection algorithm: repeatedly pick a process whose Request <= Work and release its allocation. The processes that can never be picked are P1, P4, P5.
More Operating Systems questions
- Three processes all arrive at time 0 in the order A, B, C and are scheduled FCFS (non-preemptive on the CPU). Each alternates CPU burst…
- A 3-level feedback queue scheduler uses strict priority between levels. Level 0 has quantum 2 ms, level 1 has quantum 4 ms, level 2 is…
- Two processes i and j (j is the other one) use shared flag[2] (initially false) and turn to guard a critical section. Entry code of four…
- Arrays A and B are 128 x 128 int matrices stored row-major, 4-byte ints, 512-byte pages (each row occupies exactly one page, A and B…
- A Unix-like file system has 1 KB blocks, 4-byte pointers, and inodes with 10 direct pointers and one single-indirect pointer. Every…
- Banker's algorithm with 3 resource types. Allocation: P0 (1,0,0), P1 (1,2,0), P2 (0,0,0), P3 (1,4,3), P4 (3,1,1). Maximum: P0 (5,3,2), P1…