Consider a system with 3 processes that share 4 instances of the same resource type

Q. Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of 𝐾 instances. Resource instances can be requested and released only one at a time. The largest value of 𝐾 that will always avoid deadlock is .

Ans: 2

Sol:

Given,
Number of processes (P) = 3
Number of resources (R) = 4

Since deadlock-free condition is:R β‰₯ P(N βˆ’ 1) + 1

Where R is total number of resources,
P is the number of processes, and
N is the max need for each resource.4 β‰₯ 3(N βˆ’ 1) + 1 3 β‰₯ 3(N βˆ’ 1) 1 β‰₯ (N βˆ’ 1) N ≀ 2

Therefore, the largest value of K that will always avoid deadlock isΒ 2.

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
We will be happy to hear your thoughts

Leave a reply

Gkseries.com
Logo
Register New Account