: Consider the following snapshot of a system: (2 points) What is the total numb
ID: 3767302 • Letter: #
Question
: Consider the following snapshot of a system: (2 points)
What is the total number of instances under each resource type in this system?
What is the content of the Need matrix?
Is the system in a safe state? If so, show one of the safe sequences. Explain your answer.
From a given snapshot, if a resource-request (0,5,2,0) from P1 arrives (notice that this request is only a subset of what P1 will eventually need to complete its task), should this request be granted at this time? Will the system remain in a safe state? Justify your answer.
Explanation / Answer
1)
Instance=allocation+avalaible
Instance for resource type A:3
Instance for resource type B:16
Instance for resource type C:10
Instance for resource type D:12
2)
NEED MATRIX=MAX-ALLOCATION
A B C D
P0 1 0 0 0
P1 0 7 5 0
P2 1 1 2 2
P3 0 1 0 3
P4 0 2 4 2
3)
YES the system is safe. safe sequence is <P0,P2,P3,P4,P1>
In these kind of problems ,first we have to calculate the need matrix.If the avalaible matrix is more than or equal to need matrix for any of the process,then we have to include that process in the safe sequence and update the avalaible matrix or values by adding allocation value of that particular process with avalaible matrix values.Then this process should continue for all the process.If need is more than avalaible matrix values ,then leave that process and check the next process .At the end come back to the process which has not been served and try to serve it.it is served,then add it into the sequence and update the avalaible matrix.
4)
When a new resource-request of (0,5,2,0) comes from P1 ,we have to substract the given values from P1 avalaible matrix values and add the given values to the P1 allocation .So after we update we get
P1 allocation as (1,5,2,0) and P1 avalaible as(1,4,0,0).Now we have to repeat the same process again by calculating new need matrix and checking again
By calculation we do not get a safe sequence here.So the system is not safe.Here we are not able to satisfy requests from P1,P2,P3 and P4.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.