Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following state of a system with four processes, P1, P2, P3, and P4, and five types of resources, RS1, RS2, RS3, RS4, and
Consider the following state of a system with four processes, P1, P2, P3, and P4, and five types of resources, RS1, RS2, RS3, RS4, and RS5 1. 0 1 1 12 0 1 0 10 1 01 01 210 0 0 0 2 0 31 0 221 0 0 1 0 21 110 21 A-(O 10 21) Using the deadlock detection algorithm described in Section 6.4.2, (a) Compute the existing resource vector (b) show that there is a deadlock in the system. Identify the process(es) that are deadlocked Explain how the system can recover from the deadlock using (c) recovery through preemption. (d) recovery through rollback (e) recovery through killing processes 5 points alidate your answers with step-by-step matrix diagrams as shown in section 6.4.2 Your explanation must be detailed and conclusive. Use matrix where necessary. In other words, if we add up all the instances of the resource j that have been allo- cated and to this add all the instances that are available, the result is the number of instances of that resource class that exist. The deadlock detection algorithm is based on comparing vectors. Let us define the relation A K B on two vectors A and B to mean that each element of A is less than or equal to the corresponding element of B. Mathematically, A B holds if and only if A, B, for 1 i S m Each process is initially said to be unmarked. As the algorithm progresses, processes will be marked, indicating that they are able to complete and are thus not deadlocked. When the algorithm terminates, any unmarked to be deadlocked. This algorithm assumes a worst-case scenario: all processes keep all acquired resources until they exit processes are known The deadlock detection algorithm can now be given as follows 1. Look for an unmarked process, Pi, for which the ith row of R is less than or equal to A If such a process is found, add the ith row of C to A, mark the process, and go back to step 1. 2. 3. If no such process exists, the algorithm terminates Consider the following state of a system with four processes, P1, P2, P3, and P4, and five types of resources, RS1, RS2, RS3, RS4, and RS5 1. 0 1 1 12 0 1 0 10 1 01 01 210 0 0 0 2 0 31 0 221 0 0 1 0 21 110 21 A-(O 10 21) Using the deadlock detection algorithm described in Section 6.4.2, (a) Compute the existing resource vector (b) show that there is a deadlock in the system. Identify the process(es) that are deadlocked Explain how the system can recover from the deadlock using (c) recovery through preemption. (d) recovery through rollback (e) recovery through killing processes 5 points alidate your answers with step-by-step matrix diagrams as shown in section 6.4.2 Your explanation must be detailed and conclusive. Use matrix where necessary. In other words, if we add up all the instances of the resource j that have been allo- cated and to this add all the instances that are available, the result is the number of instances of that resource class that exist. The deadlock detection algorithm is based on comparing vectors. Let us define the relation A K B on two vectors A and B to mean that each element of A is less than or equal to the corresponding element of B. Mathematically, A B holds if and only if A, B, for 1 i S m Each process is initially said to be unmarked. As the algorithm progresses, processes will be marked, indicating that they are able to complete and are thus not deadlocked. When the algorithm terminates, any unmarked to be deadlocked. This algorithm assumes a worst-case scenario: all processes keep all acquired resources until they exit processes are known The deadlock detection algorithm can now be given as follows 1. Look for an unmarked process, Pi, for which the ith row of R is less than or equal to A If such a process is found, add the ith row of C to A, mark the process, and go back to step 1. 2. 3. If no such process exists, the algorithm terminates
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started