0% found this document useful (0 votes)
19 views3 pages

Scenario Based Questions BankersAlgorithm

Bankers Scernario based Problems

Uploaded by

bmb9652
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Scenario Based Questions BankersAlgorithm

Bankers Scernario based Problems

Uploaded by

bmb9652
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROBLEMS ON BANKER’S ALGORITHM

1. In a college software lab, five student teams (P0 to P4) are sharing critical computing
resources:

 A – High-end workstations
 B – Licensed software kits
 C – Testing devices

The lab owns a total of 10 workstations, 5 software kits, and 7 testing devices.

Currently, the lab has allocated resources to the teams as follows:

 P0 is using (A=0, B=1, C=0); it may need up to (A=7, B=5, C=3).


 P1 is using (A=2, B=0, C=0); may need up to (A=3, B=2, C=2).
 P2 has (A=3, B=0, C=2); max is (A=9, B=0, C=2).
 P3 has (A=2, B=1, C=1); max is (A=2, B=2, C=2).
 P4 is using (A=0, B=0, C=2); max is (A=4, B=3, C=3).

Question:

After analyzing the current usage and demands, is it safe for the system to continue running
without causing a deadlock? If yes, what order can the processes be executed in to safely finish
all their tasks? If no, explain why a deadlock might occur.

2. During final project testing, the same five teams are using shared department resources:

 A – Virtual Machines, B – Database Licenses, C – Mobile Devices


 Total resources available: A = 10, B = 7, C = 10

Each team is already working with the following:

 P0 → using (A=1, B=2, C=2); max (A=3, B=3, C=2)


 P1 → using (A=2, B=0, C=0); max (A=2, B=2, C=2)
 P2 → using (A=2, B=1, C=1); max (A=4, B=3, C=3)
 P3 → using (A=0, B=2, C=1); max (A=1, B=3, C=5)
 P4 → using (A=1, B=0, C=3); max (A=3, B=3, C=3)

Now, P2 sends a request asking for 1 more Virtual Machine and 1 more Mobile Device.
PROBLEMS ON BANKER’S ALGORITHM

3. As part of an intercollege tech fair, 5 student teams (P0–P4) were given access to shared
lab resources:

 The lab has 10 powerful laptops, 6 software dongles, and 9 testing kits.

Currently:

 P0 is working with (0, 1, 0) and might still need up to (6, 5, 3)


 P1 is using (2, 0, 0) and might need up to (3, 2, 2)
 P2 has (3, 0, 3), possibly needing (6, 0, 3)
 P3 uses (2, 1, 1) and might still need (2, 2, 2)
 P4 is working with (0, 0, 2) and may need up to (4, 3, 3)

Question:

The event organizer wants to know: “Can I let all these teams continue their projects without
worrying about resource blocks or halts?”

Give your judgment — is it safe to proceed, or is there a chance some teams may be stuck
waiting forever?

4. During internal hackathon rounds, a small set of development kits were made available:

 A total of 9 CPUs, 5 Graphics Cards, and 8 Display Units are shared among 5 teams.

The teams currently hold:

 P0 → (1, 0, 1); max: (3, 2, 2)


 P1 → (2, 1, 0); max: (4, 2, 1)
 P2 → (2, 0, 1); max: (4, 1, 2)
 P3 → (1, 1, 2); max: (2, 2, 2)
 P4 → (1, 0, 1); max: (3, 1, 3)

Now, P1 sends a message asking for 1 more CPU and 1 more Graphics Card.

Question:

The lab head is wondering: “If I say yes to P1’s request right now, will all teams still be able
to complete their tasks and return resources?”

What should the lab head do? Approve or wait? Justify with logical reasoning.
PROBLEMS ON BANKER’S ALGORITHM

5. Five research students are working late night in the department with shared computing
facilities. Each one has different projects and needs:

 Resources available: Total 12 processors, 7 simulation licenses, and 10 robotic test


modules

Currently:

 P0 → using (2, 1, 2); max: (5, 3, 3)


 P1 → using (1, 1, 1); max: (3, 2, 2)
 P2 → using (3, 0, 2); max: (6, 1, 3)
 P3 → using (2, 1, 2); max: (3, 2, 4)
 P4 → using (1, 2, 1); max: (2, 3, 3)

Question:

The department is about to shut down for maintenance. The admin wants to know: “If I don’t
allocate any more resources now, will all the researchers eventually finish and free up
everything safely?”

Should the admin wait or interrupt? Decide based on the system’s condition.

You might also like