CS FundamentalsVery hardGATE CS · Advanced
The Banker's algorithm is applied to 5 processes P0-P4 and 3 resource types with Available = (1, 1, 3). P0: Allocation (1, 2, 1), Max (1, 5, 2); P1: Allocation (1, 0, 0), Max (4, 3, 1); P2: Allocation (2, 0, 1), Max (3, 1, 1); P3: Allocation (2, 1, 2), Max (2, 2, 2); P4: Allocation (0, 1, 2), Max (3, 1, 4). How many different safe sequences (orderings of all five processes in which each process can finish in turn) exist?
- A. 12
- B. 15
- C. 24
- D. 10
Correct answer: A. 12
Need = Max - Allocation. Explore every order in which a process whose need fits the current Work can run and then releases its allocation; counting all complete orders gives 12.
More Operating Systems questions
- A system with 3 resource types has Available = (0, 0, 1) and 7 processes P0-P6. P0: Allocation (1, 1, 1), Request (1, 0, 0); P1…
- A disk has cylinders 0-199. The head is at cylinder 96 and is moving towards higher numbers; the pending requests are for cylinders 21…
- A file system uses 2 KB blocks and 4-byte block pointers. Each inode has 12 direct pointers plus one single-, one double- and one…
- A 32-bit machine uses two-level paging with 4 KB pages and 4-byte entries (10 bits for the top level, 10 for the second level, 12 for the…
- A paged system has a 10 ns TLB lookup and 100 ns per memory access, with a 95% TLB hit ratio. A TLB miss costs a two-level page-table…
- A semaphore s is initialised to 0. Three threads run concurrently, and print(X) prints the single letter X atomically. Thread 1: print(A)…