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

This question was previously asked in
GATE CS 2018 Official Paper
View all GATE CS Papers >

Answer (Detailed Solution Below) 2

Free
GATE CS Full Mock Test
5.3 K Users
65 Questions 100 Marks 180 Mins

Detailed Solution

Download Solution PDF
To give each process one less than maximum demand, (K−1) resources we need 3(K−1) resources.

Provide an additional resource to any of three processes for deadlock avoidance.

Total resources = 3(K−1)+1=3K−2

Now, this 3K-2 should be less than or equal to the number of resources

3K−2 ≤ 4

3K ≤ 6

Hence K ≤ 2.

Latest GATE CS Updates

Last updated on Jan 8, 2025

-> GATE CS 2025 Admit Card has been released on 7th January 2025.

-> The exam will be conducted on 1st February 2025 in 2 shifts.

-> Candidates applying for the GATE CE must satisfy the GATE Eligibility Criteria.

-> The candidates should have BTech (Computer Science). Candidates preparing for the exam can refer to the GATE CS Important Questions to improve their preparation.

-> Candidates must check their performance with the help of the GATE CS mock tests and GATE CS previous year papers for the GATE 2025 Exam.

More Deadlock Handling Questions

Hot Links: teen patti 50 bonus teen patti vip teen patti master 2025