A system has 12 instances of a resource R shared among four processes. The maximum need and current allocation of each process are:
| Process | Max Need | Current Allocation |
|---|---|---|
| P1 | 8 | 3 |
| P2 | 9 | 4 |
| P3 | 5 | 2 |
| P4 | 3 | 1 |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. Yes, P4 P3 P1 P2
Explanation
Total allocated = 3+4+2+1 = 10, so Available = 12 − 10 = 2. Each process's remaining Need = Max − Allocation: P1 needs 5, P2 needs 5, P3 needs 3, P4 needs 2. Only P4's need (2) can be met with Available=2, so run P4 to completion first; it releases its 1 allocated unit, raising Available to 3, which now covers P3's need (3) — run P3, releasing 2 more, raising Available to 5, which covers P1's need (5) — run P1, releasing 3 more, raising Available to 8, which comfortably covers P2's need (5). Every process finishes, so the system is safe with sequence P4, P3, P1, P2, option (iii).More Computer System Architecture questions
- Match List I with List II
- The write operation in I/O operation does the following-
- Which of the following gates do not give output 1 when both the inputs are 0 - A. NAND gate B. NOR gate C. X-OR gate D. X-NOR gate
- Which of the following statements are true ? A. In the write-through policy, only the cache is updated B. In the write-back policy, both ca…
- The right sequence of suboperations that are performed in arithmetic pipeline is- A. Align the mantissas B. Add or subtract the mantissas C…
- Correct the order of instruction cycle: A. Read the effective address B. Fetch the information C. Execute the instruction D. Decode the ins…