1. Deadlocks a. Consider a system consisting of m resources of the same type, being shared by n processes, where both mand nare positive integers. Resources can be requested and released by processes only one at a time. Show that the system is deadlock free if the following two conditions hold: i. The maximum need of each process is between 1 and mresources; ii. The sum of all processes' maximum needs is less than m + n. Allocation ABCD ΤΟ 3 1 2 1 T1 2 1 0 2 T2 2 4 1 3 T3 4 1 1 0 T4 2 1 2 1 Figure 1: Banker's Algorithm Matrices Consider the snapshot of the system shown in Figure 1, in which there five threads 70-74 running with various numbers of four resource types A-D. (Assume that each resource type is distinct.) Fill in the Need matrix in the figure. b Thread Max ABCD 5 4 6 3 3 1 2 2 2 5 3 3 6 4 1 2 5 6 7 5 A Need B C D Available ABCD 4225 c. Using the banker's algorithm, determine if the system is in a safe state. If the state is safe, show the order in which the threads execute. Otherwise, explain why the state is unsafe.

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
1. Deadlocks
a. Consider a system consisting of m resources of the same type, being shared by n processes, where both mand nare positive integers. Resources can be
requested and released by processes only one at a time. Show that the system is deadlock free if the following two conditions hold:
i. The maximum need of each process is between 1 and m resources;
ii. The sum of all processes' maximum needs is less than m + n.
Allocation
Max
A B C D
A
B C D
3 1 2 1
5 4 6 3
2 1 0
b.
Thread
ΤΟ
T1
T2
2 4 1
4 1 1
2
3
T3
T4
2 1 2 1
Figure 1: Banker's Algorithm Matrices
0
3 1 2 2
2 5 3 3
6 4 1 2
5 6 7 5
A
Need
B C
D
Available
A B C D
4 2 2 5
Consider the snapshot of the system shown in Figure 1, in which there five threads TO-T4 running with various numbers of four resource types A-D.
(Assume that each resource type is distinct.) Fill in the Need matrix in the figure.
c. Using the banker's algorithm, determine if the system is in a safe state. If the state is safe, show the order in which the threads execute. Otherwise, explain
why the state is unsafe.
Transcribed Image Text:1. Deadlocks a. Consider a system consisting of m resources of the same type, being shared by n processes, where both mand nare positive integers. Resources can be requested and released by processes only one at a time. Show that the system is deadlock free if the following two conditions hold: i. The maximum need of each process is between 1 and m resources; ii. The sum of all processes' maximum needs is less than m + n. Allocation Max A B C D A B C D 3 1 2 1 5 4 6 3 2 1 0 b. Thread ΤΟ T1 T2 2 4 1 4 1 1 2 3 T3 T4 2 1 2 1 Figure 1: Banker's Algorithm Matrices 0 3 1 2 2 2 5 3 3 6 4 1 2 5 6 7 5 A Need B C D Available A B C D 4 2 2 5 Consider the snapshot of the system shown in Figure 1, in which there five threads TO-T4 running with various numbers of four resource types A-D. (Assume that each resource type is distinct.) Fill in the Need matrix in the figure. c. Using the banker's algorithm, determine if the system is in a safe state. If the state is safe, show the order in which the threads execute. Otherwise, explain why the state is unsafe.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
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