322 views
3 3 votes

A system has $4$ copies of resource $R$. There are $n$ processes, and each process requires at most $2$ copies of resource $R$ to complete its execution.

Which of the following statements is/are TRUE?

  1. THE SYSTEM IS GUARANTEED TO BE DEADLOCK-FREE IF $N=3$.
     
  2. THE SYSTEM IS GUARANTEED TO BE DEADLOCK-FREE IF $N=4$.
     
  3. THE MAXIMUM NUMBER OF PROCESSES THE SYSTEM CAN SUPPORT WITHOUT ANY POSSIBILITY OF DEADLOCK IS $3$.
     
  4. IF $N=5$, A DEADLOCK IS CERTAIN TO OCCUR.

2 Answers

3 3 votes

$$
\begin{gathered}
n(2-1)<4 \\
n(1)<4 \\
n<4
\end{gathered}
$$


This means the system is guaranteed to be deadlock-free if the number of processes $n$ is $\mathbf{3}$ or fewer.

  1. THE SYSTEM IS GUARANTEED TO BE DEADLOCK-FREE IF $N=3$ : TRUE. As calculated, $n=3$ satisfies the condition $n<4$. Even in the worst-case scenario where each of the $3$ processes holds $1$ resource $($Total $= 3)$, there is still $1$ resource left in the pool to satisfy any process's request for a second copy.
     
  2. THE SYSTEM IS GUARANTEED TO BE DEADLOCK-FREE IF $N=4$ : FALSE. If $n=4$ , it is possible for each process to hold $1$ resource. At this point, all 4 resources are exhausted. Each process will then wait for a second resource that will never become available. This is a deadlock state.
     
  3. THE MAXIMUM NUMBER OF PROCESSES THE SYSTEM CAN SUPPORT WITHOUT ANY POSSIBILITY OF DEADLOCK IS $\mathbf{3}$: TRUE. This is the direct result of our inequality $n<4$. If $n$ increases to $4$, the "guarantee" of being deadlock-free disappears.
     
  4. IF $N=5$, A DEADLOCK IS CERTAIN TO OCCUR: FALSE. In GATE questions, "certain to occur" is a very strong claim. While deadlock is possible if $n=5$, it is not certain. If one process finishes its execution and releases its resources before the others hit their peak demand, the system can still complete all tasks without deadlocking.
0 0 votes

For Single resource type, with:

  • m total instances

  • n processes

  • Each process needs at most k instances

Then, The system is guaranteed deadlock-free if:

                    m ≥ n ( k − 1 ) + 1

here m=4 , k=2 so n<=3 So A and C are True 

Answer:
Position:
Show:

Related questions

4 4 votes
1 1 answer
230
230 views
GO Classes asked Feb 16
230 views
An inode-based file system uses $4$ KB blocks and $4$-byte disk addresses. The inode contains $12$ direct block pointers, $1$ single indirect pointer, and $1$ double indi...
2 2 votes
1 1 answer
227
227 views
GO Classes asked Feb 16
227 views
Consider three concurrent processes $P_1, P_2$, and $P_3$ sharing a single counting semaphore $\verb|S|$ initialized to $\mathbf{2}$. Each process executes the following ...
2 2 votes
2 2 answers
241
241 views
GO Classes asked Feb 16
241 views
Consider three processes with the following CPU burst times: $P_1=2, P_2=7$, and $P_3=10$. All processes arrive at time $t=0$. The system uses Round Robin scheduling with...
4 4 votes
2 2 answers
272
272 views
GO Classes asked Feb 16
272 views
A computer system uses $\mathbf{32}$-bit virtual addresses. The system implements a two-level hierarchical paging scheme. The page size of the Outer Page Table is exactly...