Question Details

There are 5 processes in a system. The maximum number of records a process can take is 2. At a time, a process can take only a single resource and can free only a single resource. How many records are required to ensure deadlock-free execution ?

Show Answer
Correct Answer
6

Solution :

The correct answer is 6.

To determine the minimum number of resources (records) required to guarantee a deadlock-free execution, we can apply the resource allocation principle for deadlock prevention.

Let:
- N be the number of processes in the system. Here, N=5.
- Ri be the maximum number of resources required by process i. Here, each process requires a maximum of 2 resources, so Ri=2 for all i.

To find the worst-case allocation where a deadlock can potentially occur, we consider the state where every process is allocated one resource less than its maximum requirement. In this state, no process can complete, and all processes are waiting for their remaining resource.

The maximum number of resources that can be allocated without satisfying any process's complete request is:
∑i=1N(Ri-1)

Substituting the given values:
(2-1)+(2-1)+(2-1)+(2-1)+(2-1)=5×1=5

If the system has only 5 resources, it is possible for each of the 5 processes to hold 1 resource and wait indefinitely for a second resource, resulting in a deadlock.

To guarantee that a deadlock will never occur, we must add at least 1 more resource to the system. This additional resource ensures that at least one process can acquire its maximum required resources, run to completion, and subsequently release all its held resources back to the pool for other processes to use.

Therefore, the minimum number of resources (records) required for deadlock-free execution is:
5+1=6

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • SSC
  • intermediate
  • 1 hour
  • english, general awareness, general intelligence and reasoning, logical reasoning, quant

SSC CHSL Tier-1 Shift 1 2 July 2024 question paper with answers and detailed solutions. This practice paper covers questions from General Intelligence & Reasoning, General Awareness, Quantitative Aptitude, and English Language as asked in the SSC CHSL Tier-1 examination. Practice the SSC CHSL 2 July 2024 Shift 1 paper to understand the exam pattern, question types, difficulty level, and important topics for upcoming SSC CHSL exams.

  • SSC
  • intermediate
  • 1 hour
  • english, general awareness, general intelligence and reasoning, logical reasoning, quant

SSC CHSL Tier-1 Shift 2 held on 2 July 2024 question paper with answers and detailed solutions. This previous year paper covers General Intelligence & Reasoning, Quantitative Aptitude, General Awareness, and English Language. The SSC CHSL Tier-1 exam was conducted in CBT mode with 100 questions for 200 marks and a 60-minute duration.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: