CS FundamentalsVery hardGATE CS
Deadlock detection, resources (A, B, C), Available = (1, 0, 0). Allocation / Request: P1 (0,1,0) / (1,0,0), P2 (1,0,1) / (0,2,0), P3 (0,1,1) / (1,0,1), P4 (1,0,0) / (0,0,2). Which processes are deadlocked?
- A. P2, P3 and P4
- B. None; all can finish
- C. P2 and P3 only
- D. All four
Correct answer: A. P2, P3 and P4
P1's request fits, so it finishes and releases (0,1,0), making Available (1,1,0). P2 needs two B, P3 needs a C and P4 needs two C; none fits, so P2, P3 and P4 are deadlocked. P1 is not, because its request could be met.
More Operating Systems questions
- Four processes need at most 3, 4, 5 and 2 units of one resource type and request them one at a time in any order. What is the smallest…
- Semaphores s = 0 and t = 0. P1: print A; signal(s); wait(t); print B. P2: wait(s); print C; signal(t); wait(s); print D. P3: print E…
- How many processes exist at the end, including the original? (Every fork() succeeds.) c fork() && (fork() || fork()); fork();
- f.txt does not exist at the start. Program X: fd = open("f.txt", OWRONLY|OCREAT, 0644); then fork(); the child writes "cd" and exits; the…
- Cylinders 0–299; the head is at 140 and moving toward higher numbers. Requests: 45, 210, 160, 12, 275, 98, 130, 190. Which of SSTF and…
- A disk spins at 7200 RPM, has an average seek of 6 ms and 500 sectors of 512 bytes per track. A 1 MB file is read as 256 blocks of 4 KB…