Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  What is the minimum number of resources requi... Start Learning for Free
What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.
  • a)
    3
  • b)
    7
  • c)
    9
  • d)
    10
Correct answer is option 'D'. Can you explain this answer?
Most Upvoted Answer
What is the minimum number of resources required to ensure that deadlo...
let the resources needed by P1 = R1 =3, the number of resources needed by P2 = R2 = 4 and so on.. Minimum resources required to ensure that deadlock will never occur = (R1-1) + (R2 1) + (R3-1) + 1 = (3-1) + (4-1)+ (5-1) + 1 = 10. Option (D) is correct.
Free Test
Community Answer
What is the minimum number of resources required to ensure that deadlo...
To ensure that deadlock never occurs, we need to guarantee that the system can satisfy the resource requests of each process in a safe sequence. The minimum number of resources required can be determined using the Banker's algorithm.

Banker's Algorithm:
1. Available Resources: The number of available resources of each type is denoted by a vector. Let's assume it is Avail[3] = {a, b, c}.
2. Maximum Demand: The maximum number of resources of each type that each process can request is denoted by a matrix. Let's assume it is Max[3][3] = {{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3}}.
3. Allocated Resources: The number of resources of each type currently allocated to each process is denoted by a matrix. Let's assume it is Alloc[3][3] = {{p1, q1, r1}, {p2, q2, r2}, {p3, q3, r3}}.
4. Need Matrix: The number of resources of each type that each process still needs to complete its execution is denoted by a matrix. It can be calculated as Need[i][j] = Max[i][j] - Alloc[i][j].

In this case:
- Available Resources (Avail) = {3, 4, 5}.
- Maximum Demand (Max) = {{x1, y1, z1}, {x2, y2, z2}, {x3, y3, z3}}.
- Allocated Resources (Alloc) = {{p1, q1, r1}, {p2, q2, r2}, {p3, q3, r3}}.
- Need Matrix (Need) can be calculated as Need[i][j] = Max[i][j] - Alloc[i][j].

Safety Algorithm:
1. Initialize the Work vector as the Available vector and the Finish vector as false for all processes.
2. Find a process Pi whose Finish[i] is false and Need[i] is less than or equal to the Work vector. If no such process exists, go to step 4.
3. Add the Allocated resources of process Pi to the Work vector and set Finish[i] as true. Repeat step 2.
4. If all processes have Finish[i] as true, then the system is in a safe state. Otherwise, it is in an unsafe state.

To ensure that deadlock never occurs, the system must always be in a safe state. In the worst-case scenario, each process may require the maximum number of resources of each type. Hence, to satisfy the maximum demand of each process, the system should have a minimum of:
- x1 + y1 + z1 + x2 + y2 + z2 + x3 + y3 + z3 resources.

In this case, the minimum number of resources required is:
- 3 + 4 + 5 + 3 + 4 + 5 + 3 + 4 + 5 = 36.

Therefore, the correct answer is option 'D' (10).
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer?
Question Description
What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer?.
Solutions for What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer?, a detailed solution for What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.a)3b)7c)9d)10Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev