216 views
Consider an operating system containing $n$ processes each requiring $4$ resources. The maximum number of processes that can be executed without any deadlock if there are $21$ resources is available  ______

## 1 Answer

Best answer

The standard Rule is :

A system with m resources of same type being shared by n processes.  Resources can be requested and released by processes only on at a time .

The system is deadlock free if and only if --> The sum of all max needs is < m+n "

Now here in this question

1. n processes each requiring 4 resources. So  total maximum need  are 4n.

2. There are 21 resources are in total which is shared by n processes.

so applying above stated Rule

4n < 21+n

=> 3n< 21

=> n < 7 hence number of process must be less than 7 , which is 6 at maximum .( asked in the question) .

by

### 4 Comments

is thiz standard formula ?

The system is deadlock free if and only if

The sum of all max needs is < m+n

This Rule use here.

i know what is banker algo ....tell wht u want to say.

yes @wanted , please see what i did here,

The standard Rule is :

A system with m resources of same type being shared by n processes.  The system is deadlock free if and only if --> The sum of all max needs is < m+n "

Now here in this question

1. n processes each requiring 4 resources. So  total maximum need  are 4n.

2. There are 21 resources are in total which is shared by n processes.

so applying above stated Rule

4n < 21+n

=> 3n< 21

=> n < 7 hence number of process must be less than 7 , which is 6 ( as maximum no of process can be executed asked in the question ).

Answer:

2 votes
3 answers
1
536 views
0 votes
1 answer
2
0 votes
1 answer
3
255 views
0 votes
1 answer
4