CS FundamentalsVery hardGATE CS
Resources A, B, C, D. Available = (1,5,2,0). Allocation: P0 (0,0,1,2), P1 (1,0,0,0), P2 (1,3,5,4), P3 (0,6,3,2), P4 (0,0,1,4). Max: P0 (0,0,1,2), P1 (1,7,5,0), P2 (2,3,5,6), P3 (0,6,5,2), P4 (0,6,5,6). Is the state safe, and can P1's request (0,4,2,0) be granted immediately?
- A. Unsafe; the request can be granted
- B. Safe; the request can be granted
- C. Safe; the request cannot be granted
- D. Unsafe; the request cannot be granted
Correct answer: B. Safe; the request can be granted
Need: P0 (0,0,0,0), P1 (0,7,5,0), P2 (1,0,0,2), P3 (0,0,2,0), P4 (0,6,4,2). A safe sequence is P0, P2, P1, P3, P4. After granting P1 (0,4,2,0), Available = (1,1,0,0); P0 (need 0) can finish, then the others in some order, so the new state is still safe.
More Operating Systems questions
- Disk cylinders 0–199, head at 100 moving toward 0. Requests: 23, 89, 132, 42, 187, 9, 155, 61. Under C-SCAN moving DOWN (service while…
- Disk cylinders 0–199, head at 100. Requests: 23, 89, 132, 42, 187, 9, 155, 61. What is the total head movement under FCFS and under SSTF?
- What is printed (ignoring order)? (Every fork() succeeds.) c int main() { for (int i = 0; i < 3; i++) { if (fork() == 0) { printf("%d "…
- How many numbers are printed in total, and what is their sum? (Every fork() succeeds; output unbuffered.) c int main() { for (int i = 0; i…
- Round Robin, quantum 2, processes (arrival, burst): A (0, 3), B (1, 5), C (2, 2), D (3, 4), E (4, 1). A process arriving exactly when a…
- Processes spend 60% of their time waiting for I/O, independently. Using CPU utilisation = 1 − pⁿ, what is the minimum degree of…