1,566 views
0 votes
0 votes
a system has 6 processes sharing 7 resourses if each process needs maximum 3 units then

a) deadlock can never occur

b)deadlock may occur

c)starvation will occur

d)none of these

4 Answers

Best answer
2 votes
2 votes

Option B :

Refer to Galvin : If (no. of processes * max need of each process) < (no of processes + total no of resources), the deadlock will not occur .

Therefore, in our question, 6*3 < 6+7 ? Which is false , which implies deadlock may occur.

Or if you see it as allocation of resources, assume that :

Process Id No of resources allocated
P1 1+1
P2 1
P3 1
P4 1
P5 1
P6 1

If resources are allocated ike this, its a deadlock.

selected by
1 votes
1 votes
deadlock will occur

No of process in system = 6

Total resouces = 7

At the worst case if give 2 resouces each Process = 2*6 =12 and then 1 resources more so that we can break and start one process and so on . So min of no resources required to be deadlock free is 13

but Resources in system = 7

Since 7<13 ( MIN required )

So the condition is a deadlock .
1 votes
1 votes

answer is option b) Deadlock may occur

example :  the allocation sequence of resources = (2, 2, 2, 1, 0, 0) means deadlock

Related questions

1 votes
1 votes
1 answer
2
FaisalSyed asked Mar 16, 2023
298 views
Does Waiting Time and Response TIme remains the same in Preemptive Scheduling Algorithm???