in Operating System edited by
2,165 views
0 votes
0 votes
Consider a system which has $28$ instances of a resource $P$ such that $4+n$ processes share them,$4$ process request $5$ instances of $'P'.$ If $n$ process request $5$ instances of same resources what is the maximum value of $n$ such that system is in safe state______
in Operating System edited by
2.2k views

3 Comments

2?
0
0
Yes, please add the answer in a detailed way, I'm confused in this question.
0
0

@Lakshman Patel RJIT please check.. let me know in case of any clarification

0
0

1 Answer

3 votes
3 votes
Best answer
Given : Total Resources: 28

Total no of processes : 4+n

Out of this 4 process require 5 resources and n require 5. So For the minimum no of processes for which deadlock occurs we will take away 1  resource from each of the process. So total 4 processes have 4 resources each and n have 4.

So that means 4*4+4*n=28 for deadlock so for deadlock minimum val of n is n=(28-16)/4=3

This causes deadlock. So for system to be deadlock free maximum value of n is = 3-1=2. This is because this value of n will not lead to any deadlock 3 would. So we first calculate the  value for minimum value which causes deadlock and then subtract 1 for max value which wont cause deadlock.
selected by

14 Comments

edited by

@  In given question what are $P$ here?

0
0
P is a type of resource whose instances are given to us..
0
0

@ 

So, maximum value of $n=3-1=2$ (Safe state or no deadlock)

and the minimum number of process with deadlock(unsafe)$n=3$

I learn from your solution.

please correct me if I'm wrong$?$

1
1
1
1
Thank you so much
0
0
edited by

@ 

A system has $3$ resources and $5$ process competing for them.Each process can request a maximum of $'N'$ instances.The largest value of $N$ that will always avoid deadlock is_______$?$

1
1
0
0

@Lakshman Patel RJIT only one resource can be the maximum request for a deadlock free situation in this case. 

0
0
can you explain, please?
0
0
for deadlock we assign n-1 resources to each process. So as we have 3 resources available and 5 processes so it means 5(n-1)+1=3 for no deadlock so n-1=2/5-> n=1.4 so we can have maximum 1 resource request per process
1
1
more accurate $5(n-1)+1\leq 3$ for deadlock free
1
1

@ 

I also did same, but i mark the answer as $2$, which is wrong.

thanks to you

0
0
As we know

here total no of resources=28

total no of process=4+n

total demand=20+5n

total no of resources+total no of process>total demand

28+4+n>5n+20

32+n>5n+20

32-20>5n-n

12>4n

3>n

min no process that ensure deadlock=3

maximum no process that ensure no deadlock=3-1=2
0
0

Related questions