Consider the following snapshot of a system at time t ALLOCATION MAXIMUM PROCESS P1 4 12 10 P2 2. 3. 4 3. P3 1 P4 6. 12 P5 2. 3 Initially there are: 16 units of the resource A, 20 units of the resource B, and 17 units of the resource C. Answer the following questions using the banker's algorithm: a. Determine the Available, and Total Allocated matrix based on the above data. b. What is the content of the Need matrix? c Is the system in a safe state or not? If it is, show how the processes can complete. Justify your answ'er. 2) 96 4. 3. 2. 1. 2) %24

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Consider the following snapshot of a system at time t
ALLOCATION
MAXIMUM
PROCESS
P1
4
12
10
P2
2.
3.
4
3.
P3
1
P4
6.
12
P5
2.
3
Initially there are:
16 units of the resource A,
20 units of the resource B, and
17 units of the resource C.
Answer the following questions using the banker's algorithm:
a.
Determine the Available, and Total Allocated matrix based on the above data.
b. What is the content of the Need matrix?
c Is the system in a safe state or not? If it is, show how the processes can complete. Justify
your answ'er.
2)
96
4.
3.
2.
1.
2)
%24
Transcribed Image Text:Consider the following snapshot of a system at time t ALLOCATION MAXIMUM PROCESS P1 4 12 10 P2 2. 3. 4 3. P3 1 P4 6. 12 P5 2. 3 Initially there are: 16 units of the resource A, 20 units of the resource B, and 17 units of the resource C. Answer the following questions using the banker's algorithm: a. Determine the Available, and Total Allocated matrix based on the above data. b. What is the content of the Need matrix? c Is the system in a safe state or not? If it is, show how the processes can complete. Justify your answ'er. 2) 96 4. 3. 2. 1. 2) %24
Expert Solution
Step 1

The Banker's Algorithm is a method used in computer science to ensure that a system can avoid deadlocks when allocating resources to multiple processes. It is used in operating systems to manage the allocation of resources such as memory, disk space, and peripheral devices. The algorithm is based on the concept of a safe state, where a set of processes can be executed without the risk of deadlock.

Step 2

a. To determine the Available and Total Allocated matrices, we need to calculate the currently available resources for each resource type (A, B, and C) by subtracting the allocated resources from the initial resources.

Total Allocated matrix:

A: 3+2+1+5+2 =13

B: 4+3+1+6+3 = 17

C: 4+4+1+5+2 = 16

Available = Total allocate - initial

Available metrics are as follows:

A: 16 - (3+2+1+5+2)=3

B: 20 - (4+3+1+6+3)=3

C: 17 -(4+4+1+5+2) =1

 

b. The content of the need matrix is calculated by the following formula:

Need = maximum - allocation

Need for P1 = (12  10  8) - (3  4  4) = 9  6  4

Need for P2 = (3  5  7) - (2  3  4) = 1  2  3

Need for P3 = (2  3  2) - (1  1  1) = 1  2  1

Need for P4 = (6  12  6) - (5  6  5) = 1  6  1

Need for P5 = (4  5  4) - (2  3  2) = 2  2  2

 

Process Need
  A    B    C
P1 9    6    4
P2 1    2    3
P3 1    2    1
P4 1    6    1
P5 2    2    2

 

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY