1. Answer ALL questions. 2. You can answer it with a ... - MetaLab

1. Answer ALL questions. 2. You can answer it with a ... - MetaLab 1. Answer ALL questions. 2. You can answer it with a ... - MetaLab

uniten.edu.my
from uniten.edu.my More from this publisher

B. What is the minimum number of resource R 1 needs for the state describedin table below to be safe? Explain your <strong>answer</strong> by giving the order ofprocesses that <strong>can</strong> be finished w<strong>it</strong>h the minimum number of R 1 needed.ProcessCurrentAllocationMaximumAllocationR 1 R 1P1 1 3P2 1 2P3 3 9P4 2 7[3 marks]C. Consider the following state of a system consisting of four processes andthree resources.R1 R2 R30 1 1Available VectorR1 R2 R3R1 R2 R3P1P2P3P4585643344564P1P2P3384223322434Claim MatrixP4Allocation Matrix(a)Draw the content of the Need matrix.[4 marks]Page 2 of 6Semester 1 11/12


(b)Is this system currently in safe or unsafe state?[1 mark](c)(d)If <strong>it</strong> is in safe state, give the order of process to finish and if <strong>it</strong> is inunsafe state, state which process may become deadlock.[2 marks]P1 makes the request for one add<strong>it</strong>ional un<strong>it</strong> R<strong>2.</strong> Can this requestbe safely granted immediately? Explain your <strong>answer</strong>.[3 marks]Question 2A. Consider the following figure that shows a system, consisting of fourprocesses and five resources. Apply the deadlock detection algor<strong>it</strong>hm tothe following data and show the result.R1 R2 R3 R4R1 R2 R3 R4P15334P13343R1 R2 R3 R4P24343P253345 4 3 3P34433P33453Available VectorRequest Matrix QAllocation Matrix A[5 marks]Page 3 of 6Semester 1 11/12


B. Consider a system w<strong>it</strong>h five processes and three resources. Apply thedeadlock detection algor<strong>it</strong>hm to the following data and show the results.Allocation Request AvailableA B C A B C A B CP1 0 1 0 0 0 0 0 0 0P2 2 0 0 2 0 2P3 3 0 3 0 0 0P4 2 1 1 1 0 0P5 0 0 2 0 0 2[5 marks]Question 3A. Consider the following set of processes w<strong>it</strong>h the length of correspondingCPU burst time and arrival time given for each of the process.Process Arrival time Burst TimeA 0 6B 2 5C 3 6D 5 6Draw the scheduling diagram illustrating the execution of these processesand find the average wa<strong>it</strong>ing time for the following scheduling algor<strong>it</strong>hms.(a)(b)First Come First ServeShortest Process Next[3 marks][3 marks]Page 4 of 6Semester 1 11/12


(c)(d)Shortest Remaining TimeRound Robin w<strong>it</strong>h time quantum 1ms[4 marks][5 marks](e)Highest Response Ratio Next[4 marks](f) Feedback w<strong>it</strong>h the following information:Prior<strong>it</strong>y Queue Time Quantum (ms)RQ0 1RQ1 1RQ2 2[5 marks]B. The following table shows a set of 4 processes w<strong>it</strong>h their arrival time andburst time:Process Arrival time Service TimeA 0 5B 2 4C 3 5D 5 3Draw the scheduling diagram and find the average wa<strong>it</strong>ing time for theprocesses above using the scheduling algor<strong>it</strong>hm below:(g) First Come First Serve[3 marks](h) Shortest Process Next[3 marks]Page 5 of 6Semester 1 11/12


(i)(j)Shortest Remaining TimeRound Robin w<strong>it</strong>h time quantum 1ms[4 marks][5 marks](k)Highest Response Ratio Next[4 marks](l)Feedback w<strong>it</strong>h the following information:Prior<strong>it</strong>y Queue Time Quantum (ms)RQ0 2RQ1 1RQ2 1[5 marks]Page 6 of 6Semester 1 11/12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!