Description
-
(25pts) Write a short program in C/C++ that creates two processes that deadlock. You MUST remove the deadlocked processes from the system (kill -9) once you have completed your experiments.
-
(25) Prove the correctness or give a counter-example for each of the following statements. You must state whether the statement is true or false and then show your arguments.
-
-
deadlock cycle
-
cycle deadlock
-
knot deadlock
-
deadlock knot
-
-
(25pts) Consider the following maximum-claim reusable resource system with four processes (P0, P1, P2, P3) and three resource types (R0, R1, R2). The maximum claim matrix is given by
-
4
1
4
3
1
4
C =
5
6
13
1
1
6
where Cij denote maximum claim of process i for resource j. The total number of units of each resource type is given by the vector (5, 8, 15). The current allocation of resources is given by the matrix
-
0
1
4
2
0
1
A =
1
2
1
1
0
3
where Ai,j denotes the units of resources of type j currently allocated to process i. For the state shown above:
-
determine if the current state of the system is safe.
-
determine if a request by process 1 for 1 unit of resource 1 can be safely granted.
-
determine if a request by process 2 for 4 units of resource 2 can be safely granted.
(Note: Processes and Resources start with index 0). You must show your work and justify each of your answers.
-
(25) Consider the following set of five processes where arrival is the time the process became ready, t is the total service time, and e is the external priority. Assume that execution starts immediately at time 0 and there is no context switch overhead.
-
process
arrival
t
e
p0
0
80
9
p1
15
25
10
p2
15
15
9
p3
85
25
10
p4
90
10
11
For the following scheduling disciplines, draw a time diagram showing when each of the five processes executes. (In the case of a tie, assume that the process with the lower process number executes first.) Calculate the average waiting time for each of the scheduling disciplines.
-
FIFO
-
SJF
-
SRT
-
RR (quantum = 10)
-
ML (using FIFO at each priority level)