CS FundamentalsVery hardGATE CS (PYQ pattern)
Six processes share identical units of one resource; each needs at most 4 units. Five of them request units one at a time, holding what they have while waiting. The sixth process requests all 4 of its units in a single atomic request (granted only when 4 units are free) and holds nothing before that. What is the minimum number of units that makes deadlock impossible?
- A. 19
- B. 15
- C. 16
- D. 18
Correct answer: C. 16
A deadlock needs every unfinished process blocked. The one-at-a-time processes block only when 0 units are free, and the atomic process never holds anything while waiting, so the worst case is the five others holding 3 each with nothing free: 15 units deadlock. With 16, one unit is always free when the five hold at most 15, so some process can finish. The formula 6 x (4 - 1) + 1 = 19 wrongly assumes the sixth process can also sit on 3 units.
More Operating Systems questions
- The disk has cylinders 0 to 199. The head is at 100, moving towards higher cylinders. Pending requests: 23, 89, 132, 42, 187, 70, 12. SCAN…
- With 3 frames (initially empty) the reference string is 2, 5, 3, 6, 2, 5, 4, 2, 4, 2, 1, 2, 5, 6, 6, 1, 2, 3, 6, 3, 4, 4. The clock…
- A file of 100,000 bytes is stored on a disk with 512-byte blocks. Under linked allocation each block holds a 4-byte next-pointer and 508…
- A 2^40-byte disk uses 4 KB blocks. Free space can be tracked either by a bitmap (1 bit per block) or by a plain list of free block…
- A 10,000 RPM disk has an average seek time of 5 ms and a sustained transfer rate of 100 MB/s (1 MB = 10^6 bytes). It serves a stream of…
- A one-slot buffer uses semaphores mutex = 1, empty = 1, full = 0. The producer runs twice: wait(mutex); wait(empty); print p…