CS FundamentalsHardGATE CS
A system has resource types A, B, C. Available = (2,1,0). Allocation: P0 (1,1,0), P1 (0,1,2), P2 (2,0,1), P3 (1,0,0). Max: P0 (3,2,2), P1 (1,2,3), P2 (3,1,1), P3 (2,2,1). Which statement is correct?
- A. The state is unsafe because Available has no instance of C
- B. The state is safe and P3 must run first
- C. The state is safe and every order of the four processes is a safe sequence
- D. The state is safe; P3 cannot be the first process in any safe sequence
Correct answer: D. The state is safe; P3 cannot be the first process in any safe sequence
Need = Max − Allocation: P0 (2,1,2), P1 (1,1,1), P2 (1,1,0), P3 (1,2,1). With Available = (2,1,0) only P2 (need 1,1,0) can start; after it releases, Available grows and the rest follow. A safe sequence exists, e.g. P2 → P1 → P0 → P3. P3 needs (1,2,1), more B than the 1 available, so it cannot go first; an empty Available column alone does not make a state unsafe.
More Operating Systems questions
- Banker's algorithm state: Available = (3,3,2). Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,2), P3 (2,1,1), P4 (0,0,2). Max: P0 (7,5,3), P1…
- Two resource types X, Y. Available = (1,1). Allocation: P0 (1,0), P1 (0,1), P2 (1,1). Max: P0 (2,1), P1 (1,2), P2 (2,2). How many of the…
- A system has R identical instances of a resource shared by 4 processes needing at most 3, 4, 5 and 2 instances respectively. What is the…
- n processes share 12 identical units of a resource, and each process may need up to 4 units. What is the largest n for which deadlock is…
- k processes each need at most 3 instances of a resource that has 7 instances in total. Requests are made one instance at a time. What is…
- Deadlock detection (multi-instance). Available = (0,0,0). Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,3), P3 (2,1,1), P4 (0,0,2). Current…