**Problem-01:**

**Considering a system with four processes P0 through P3 and three resources of type A, B, C. Resource type A has 10 instances, B has 5 instances and type C has 7 instances. Suppose at time t0 following snapshot of the system has been taken:**

**Question1. What will be the content of the Need matrix?**

**Question2. Is the system in a safe state? If Yes, then what is the safe sequence?**

**Problem-02:**

**Question1. What will be the content of the Need matrix?**

**Question2. Is the system in a safe state? If Yes, then what is the safe sequence?**

**Question3. What will happen if process P1 requests one additional instance of resource type A and two instances of resource type C?**

**Problem-03:**

A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish LAST?

- P0
- P1
- P2
- None of the above since the system is in a deadlock

**Problem-04:**

An operating system uses the banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y and Z to three processes P0, P1 and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

Allocation | Max | |||||

X | Y | Z | X | Y | Z | |

P0 | 0 | 0 | 1 | 8 | 4 | 3 |

P1 | 3 | 2 | 0 | 6 | 2 | 0 |

P2 | 2 | 1 | 1 | 3 | 3 | 3 |

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in safe state. Consider the following independent requests for additional resources in the current state-

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z

REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which of the following is TRUE?

- Only REQ1 can be permitted
- Only REQ2 can be permitted
- Both REQ1 and REQ2 can be permitted
- Neither REQ1 nor REQ2 can be permitted

**Problem-05:**

A system has 4 processes and 5 allocatable resource. The current allocation and maximum needs are as follows-

Allocated | Maximum | |||||||||

A | 1 | 0 | 2 | 1 | 1 | 1 | 1 | 2 | 1 | 3 |

B | 2 | 0 | 1 | 1 | 0 | 2 | 2 | 2 | 1 | 0 |

C | 1 | 1 | 0 | 1 | 1 | 2 | 1 | 3 | 1 | 1 |

D | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 2 | 2 | 0 |

If Available = [ 0 0 X 1 1 ], what is the smallest value of x for which this is a safe state?

**Problem-06:**

An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is

currently in a safe state. Consider the following independent requests for additional resources in the

current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which one of the following is TRUE?**(A)** Only REQ1 can be permitted.**(B)** Only REQ2 can be permitted.**(C)** Both REQ1 and REQ2 can be permitted.**(D)** Neither REQ1 nor REQ2 can be permitted

**Problem-07:**

A system has 12 magnetic tape drives and 3 processes : P0, P1, and P2. Process P0 requires 10 tape drives, P1 requires 4 and P2 requires 9 tape drives.

Process P0 P1 P2 Maximum needs (process-wise: P0 through P2 top to bottom) 10 4 9 Currently allocated (process-wise) 5 2 2

Which of the following sequence is a safe sequence?

a) P0, P1, P2

b) P1, P2, P0

c) P2, P0, P1

d) P1, P0, P2