CS FundamentalsVery hardGATE CS
Banker's algorithm, resources (A, B, C). Available = (1, 1, 2). Allocation / Max: P0 (1,0,1)/(2,1,2), P1 (2,1,0)/(3,2,2), P2 (0,1,1)/(1,2,3), P3 (1,0,0)/(3,1,2). How many of the 24 orderings of P0-P3 are safe sequences?
- A. 18
- B. 6
- C. 12
- D. 16
Correct answer: D. 16
Needs are (1,1,1), (1,1,2), (1,1,2), (2,1,2). P3 cannot go first, but P0, P1 or P2 can; after P0 or P1 everything else fits in any order (2 × 6 = 12). After P2 alone the pool is (1,2,3), still short for P3, so of its 6 orders the 2 with P3 second fail: 12 + 4 = 16.
More Operating Systems questions
- How many times is x printed? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { fork(); fork() && fork()…
- How many numbers are printed, and what is their sum? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { for…
- Which letters are printed, and how many times each? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { if…
- Periodic tasks T1 (execution 2, period 5) and T2 (execution 4, period 7), deadlines equal to periods. Which statement is correct?
- Each process spends 50% of its time waiting for I/O, independently of the others. Under the simple model CPU utilisation = 1 − pⁿ, what is…
- Memory access takes 100 ns. A page fault occurs once per million accesses; servicing it takes 8 ms if the victim page is clean and 20 ms…