CS FundamentalsVery hardGATE CS (PYQ pattern)
A system has 3 resource types and processes P0-P3. Allocation: P0 (1,0,1), P1 (2,1,0), P2 (1,1,1), P3 (0,1,2). Maximum: P0 (3,2,2), P1 (4,1,2), P2 (2,2,2), P3 (1,3,3). Available = (1,2,1). By the Banker's algorithm, the number of distinct safe sequences is:
- A. 6
- B. 8
- C. 12
- D. 24
Correct answer: B. 8
Need = P0 (2,2,1), P1 (2,0,2), P2 (1,1,1), P3 (1,2,1). Only P2 and P3 can start; trying every order after each allocation release and counting those where all four finish gives 8 safe sequences.
More Operating Systems questions
- A paged system has a TLB lookup time of 10 ns, a TLB hit ratio of 90% and a memory access time of 100 ns. A TLB miss needs one extra…
- Semaphores S = 0 and T = 0 are shared. P1 executes: print A; signal(S); print B. P2 executes: wait(S); print C; signal(T). P3 executes…
- A Unix-style inode has 12 direct pointers, one single-indirect and one double-indirect pointer. Block size is 2 KB and a block pointer is…
- A process with pages numbered 0 to 4 references them in the order 0 4 0 1 3 4 0 1 4 0 2 0 4 1 3 2. Under FIFO replacement with initially…
- With 3 initially empty frames, the reference string 1 1 1 3 2 6 6 3 3 5 2 5 1 5 6 2 4 6 4 6 5 3 is processed under LRU and under the…
- A process makes 18 page references (times 1 to 18): 2 4 4 3 4 2 4 5 2 5 5 2 1 1 3 5 4 1. The working set W(t, 5) is the set of distinct…