All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Information Report

Category:
## Documents

Published:

Views: 7 | Pages: 6

Extension: PDF | Download: 0

Share

Related documents

Description

CS4410 HW3

Transcript

CS 4410: Operating SystemsHomework 3
Instructions for Homework 3:
ã
This is the third “k out of n” homeworks CS 4410.
ã
The homework may be done in pairs, or individually. If doing in pairs, one of you should upload to gradescope and add your partner to the group assignmentin the upper right corner of the screen. (Do not just upload the assignment indi-vidually or it will be graded twice, which means grading will take longer.)
ã
The deadline is Thursday, October 20 at 11:59AM.
ã
No late submissions will be accepted.
ã
You must attribute every source used to complete this homework.
ã
Please add your solutions to
this pdf
, placing your answers in the boxes pro-vided. This makes grading much simpler.
Thank you.
ã
For two questions, you will need an integer,
Int1
, to be computed as follows:
–
If you are working with a partner, let
var
be the lexicographically smallerof the two NetIDs.
–
Let
varInt
be the integral part of
var
.That is, if
var = rst123
, then
varInt = 123
.
–
Let
Int1
be the ﬁrst digit of
varInt
.That is, if
varInt = 123
, then
Int1 = 1
.Student 1 Name: , NetID:Student 2 Name: , NetID:
Int1
:
1
CS4410, Fall 2016 Homework 3 Deadline: Thursday, October 20, 11:59AM
1 Resource Allocation Graphs
In a recent SETI-at-home breakthrough, a new planet has been discovered with three-handed philosophers.There are two types of chopsticks: red and blue. Each philosopher needs 3 chopsticks to eat and all 3 chop-sticks may not be the same color. Consider a table with
(Int1 mod 4) + 3
three-handed philosophers.There is one pile of
N
red chopsticks and one pile of
M
blue chopsticks on the table. Draw a ResourceAllocation Graph that illustrates a deadlocked situation
with the largest possible value of
N
.Write down the number of philosophers calculated according to
Int1
.Draw your RAG in the box below. Make sure to label all your nodes and edges.
# of philosophers
= ,
N
= ,
M
=
1
CS4410, Fall 2016 Homework 3 Deadline: Thursday, October 20, 11:59AM
2 Deadlock Detection Algorithm
As a reminder, the deadlock detection algorithm is:
Algorithm 1
Deadlock Detection Algorithm
1. free[] = avail[]2. for all processes i: ﬁnish[i] = (alloc[i] == [0,0,...,0])3. ﬁnd process i such that ﬁnish[i] == 0 and req[i]
≤
free4. if no such i exists, goto 85. free = free + alloc[i]6. ﬁnish[i] = 17. goto 38. system is deadlocked iff ﬁnish[i] == 0 for some process i1. Your setting for this question is the
(
Int1
+
1
)
th case in the list of cases obtained from
q2l1.txt
.
Your Case No.:
Does a deadlock exist in the above system?
Your Answer:If yes
, what are the
free
and
finish
arrays once the algorithm has progressed as far as it can?
free
= [ , , ],
finish
= [ , , , ]
If no
, a possible execution sequence of these four processes is:2. Your setting for this question is the
(
Int1
+
1
)
th case in the list of cases obtained from
q2l2.txt
.
Your Case No.:
Does a deadlock exist in the above system?
Your Answer:If yes
, what are the
free
and
finish
arrays once the algorithm has progressed as far as it can?
free
= [ , , ],
finish
= [ , , , ]
If no
, a possible execution sequence is:
2
CS4410, Fall 2016 Homework 3 Deadline: Thursday, October 20, 11:59AM
3 The Banker’s Algorithm
3.1 Setup
Suppose you have a multi-process application in which each process requires some number of pages of memory. List the information needed in order to run the Banker’s Algorithm.Is it feasible for modern operating systems to utilize the Banker’s Algorithm? Why or why not? (Limityour answer to 1-2 sentences.)
3

Recommended

Related Search

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks