Assignment 1: Deadline: 04/10/2019 at 23:59
Assignment 1: Deadline: 04/10/2019 at 23:59
Assignment 1: Deadline: 04/10/2019 at 23:59
Operating Systems
Assignment 1
Deadline: 04/10/2019 @ 23:59
[Total Mark for this Assignment is 6]
Student Details:
Name: Taher Alnemer ID: s170057274
CRN: 11131
Instructions:
This Assignment must be submitted on Blackboard (WORD format only) via the allocated
folder.
Email submission will not be accepted.
You are advised to make your work clear and well-presented, marks may be reduced for poor
presentation. This includes filling your information on the cover page.
You MUST show all your work, and text must not be converted into an image, unless specified
otherwise by the question.
Late submission will result in ZERO marks being awarded.
The work should be your own, copying from students or other resources will result in ZERO
marks.
Use Times New Roman font for all your answers.
Pg. 1 Question FourQuestion Four
Learning
Outcome(s): Question One 1.5 Marks
Consider a system consisting of four resources of the same type that are shared by
Instructors: three processes, each of which needs at most two resources. Show that the system
Describe the OS is deadlock-free.
mechanism for
R1
process P1
management, P2
timing, memory,
R2
I/O, file and
concurrency R3
management. P3
R4
This is showing that each processes (P1, P2, P3) acquiring one of the 4
resources (R1, R2, R3, R4) then move to other resources which are
waiting for acquiring.
Pg. 2 Question FourQuestion Four
P1 0 8
P2 2 3
P3 6 2
P4 9 7
P P
P2 P3 P1 P4
1 1
0 2 5 6 8 13 20
P2: 2 – 2 = 0ms
P3: 6 – 6 = 0ms
P4: 13 – 9 = 4ms
Pg. 4 Question FourQuestion Four
P1 + P2 + P3 + P4 / 4 =
5 + 0 + 0 + 4 / 4 = 2.25ms
Pg. 5 Question FourQuestion Four
Process P0
do {
turn = 1;
critical section
flag[0] = false;
remainder section
} while (true);
Pg. 6 Question FourQuestion Four
Process P1
do {
turn = 0;
critical section
flag[0] = false;
remainder section
} while (true);