Operating System
106503Module 4: Deadlocks
Q1f. Which technique allows the operating system to examine the resource allocation state dynamically to ensure no deadlock occurs? (i) Deadlock detection (ii) Deadlock recovery (iii) Deadlock avoidance (iv) Deadlock ignoring20252m
Module 4: Deadlocks
View this question on its own page →Which technique allows the operating system to examine the resource allocation state dynamically to ensure no deadlock occurs?
(i) Deadlock detection
(ii) Deadlock recovery
(iii) Deadlock avoidance
(iv) Deadlock ignoringQ1g. With a single resource, deadlock occurs (i) if there are more than two processes competing for that resource (ii) if there are only two processes competing for that resource (iii) if there is a single process competing for that resource (iv) none of these20232m
Module 4: Deadlocks
View this question on its own page →With a single resource, deadlock occurs
(i) if there are more than two processes competing for that resource
(ii) if there are only two processes competing for that resource
(iii) if there is a single process competing for that resource
(iv) none of theseQ1g. Which of the following approach require knowledge of the system's state in advance. (i) Deadlock detection (ii) Deadlock prevention (iii) Deadlock avoidance (iv) None of these20222m
Module 4: Deadlocks
View this question on its own page →Which of the following approach require knowledge of the system's state in advance.
(i) Deadlock detection
(ii) Deadlock prevention
(iii) Deadlock avoidance
(iv) None of theseQ1h. Which of the following conditions is required for deadlock to be possible? (i) Mutual exclusion (ii) A process may hold allocated resources while awaiting assignment of other resources (iii) No resource can be forcibly removed from a process holding it (iv) All of the above20192m
Module 4: Deadlocks
View this question on its own page →Which of the following conditions is required for deadlock to be possible?
(i) Mutual exclusion
(ii) A process may hold allocated resources while awaiting assignment of other resources
(iii) No resource can be forcibly removed from a process holding it
(iv) All of the aboveQ1i. Which one of the following is the deadlock avoidance algorithm? (i) Banker's algorithm (ii) Round-robin algorithm (iii) Elevator algorithm (iv) Karn's algorithm20192m
Module 4: Deadlocks
View this question on its own page →Which one of the following is the deadlock avoidance algorithm?
(i) Banker's algorithm
(ii) Round-robin algorithm
(iii) Elevator algorithm
(iv) Karn's algorithmQ1j. A computer system has 6 tape drives, with *n* processes competing for them. Each process may need 2 tape drives. The maximum value of *n* for which the system is guaranteed to be deadlock free is (i) 6 (ii) 5 (iii) 4 (iv) 320232m
Module 4: Deadlocks
View this question on its own page →A computer system has 6 tape drives, with n processes competing for them. Each process may need 2 tape drives. The maximum value of n for which the system is guaranteed to be deadlock free is
(i) 6
(ii) 5
(iii) 4
(iv) 3Q3b. Justify the following statement: "Cycle in resource allocation graph does not always imply the occurrence of deadlock".20234m
Module 4: Deadlocks
View this question on its own page →Justify the following statement: "Cycle in resource allocation graph does not always imply the occurrence of deadlock".
Q4b. Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state? | Process | Allocation (A B C D) | Max (A B C D) | Available (A B C D) | | :--- | :---: | :---: | :---: | | P0 | 0 0 1 2 | 0 0 1 2 | 1 5 2 0 | | P1 | 1 0 0 0 | 1 7 5 0 | | | P2 | 1 3 5 4 | 2 3 5 6 | | | P3 | 0 6 3 2 | 0 6 5 2 | | | P4 | 0 0 1 4 | 0 6 5 6 | |20257m
Module 4: Deadlocks
View this question on its own page →Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state?
Process Allocation (A B C D) Max (A B C D) Available (A B C D) P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P2 1 3 5 4 2 3 5 6 P3 0 6 3 2 0 6 5 2 P4 0 0 1 4 0 6 5 6 Q4b. A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column 'alloc' denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Find the process that will finish first and last. | | alloc<br>X Y Z | Request<br>X Y Z | |---|---|---| | P0 | 1 2 1 | 1 0 3 | | P1 | 2 0 1 | 0 1 2 | | P2 | 2 2 1 | 1 2 0 |20227m
Module 4: Deadlocks
View this question on its own page →A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column 'alloc' denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Find the process that will finish first and last.
alloc<br>X Y Z Request<br>X Y Z P0 1 2 1 1 0 3 P1 2 0 1 0 1 2 P2 2 2 1 1 2 0 Q5a. Explain the core principle behind Deadlock Avoidance. Draw a Resource-allocation graph with a cycle but no deadlock.20247m
Module 4: Deadlocks
View this question on its own page →Explain the core principle behind Deadlock Avoidance. Draw a Resource-allocation graph with a cycle but no deadlock.
Q5b. Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state? | | Allocation | Max | Available | | :--- | :--- | :--- | :--- | | | A B C D | A B C D | A B C D | | P0 | 0 0 1 2 | 0 0 1 2 | 1 5 2 0 | | P1 | 1 0 0 0 | 1 7 5 0 | | | P2 | 1 3 5 4 | 2 3 5 6 | | | P3 | 0 6 3 2 | 0 6 5 2 | | | P4 | 0 0 1 4 | 0 6 5 6 | |20247m
Module 4: Deadlocks
View this question on its own page →Consider a system with five processes P0 through P4 and four resources type A, B, C and D. Using the Banker's algorithm answer that the system is in a safe state?
Allocation Max Available A B C D A B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P2 1 3 5 4 2 3 5 6 P3 0 6 3 2 0 6 5 2 P4 0 0 1 4 0 6 5 6 Q6a. For a deadlock to occur, each of the necessary conditions must hold. By ensuring that at least one of these conditions cannot hold, we can prevent the occurrence of a deadlock. Give one approach individually to prevent each of these necessary conditions.20237m
Module 4: Deadlocks
View this question on its own page →For a deadlock to occur, each of the necessary conditions must hold. By ensuring that at least one of these conditions cannot hold, we can prevent the occurrence of a deadlock. Give one approach individually to prevent each of these necessary conditions.
Q6a. Write necessary conditions that must hold simultaneously to arise deadlock situation. Briefly explain different deadlock handling mechanisms.20227m
Module 4: Deadlocks
View this question on its own page →Write necessary conditions that must hold simultaneously to arise deadlock situation. Briefly explain different deadlock handling mechanisms.
Q6b. Consider a system with five processes P0 through P4 and have three resource types A, B, C. Resource type A has ten instances, resource type B has five instances, and resource type C has seven instances. Suppose that the following snapshot represents the current state of the system: | | Allocation | Max | Available | | :--- | :---: | :---: | :---: | | | A B C | A B C | A B C | | P0 | 0 1 0 | 7 5 3 | 3 3 2 | | P1 | 2 0 0 | 3 2 2 | | | P2 | 3 0 2 | 9 0 2 | | | P3 | 2 1 1 | 2 2 2 | | | P4 | 0 0 2 | 4 3 3 | | The system is currently in safe state. Suppose now that P1 requests additional resources as (A=1, B=0, C=2). Is this request can be immediately granted? Justify your answer.20237m
Module 4: Deadlocks
View this question on its own page →Consider a system with five processes P0 through P4 and have three resource types A, B, C. Resource type A has ten instances, resource type B has five instances, and resource type C has seven instances. Suppose that the following snapshot represents the current state of the system:
Allocation Max Available A B C A B C A B C P0 0 1 0 7 5 3 3 3 2 P1 2 0 0 3 2 2 P2 3 0 2 9 0 2 P3 2 1 1 2 2 2 P4 0 0 2 4 3 3 The system is currently in safe state. Suppose now that P1 requests additional resources as (A=1, B=0, C=2). Is this request can be immediately granted? Justify your answer.
Q8. Define deadlock. List four necessary conditions for occurrence of deadlock. A system contains six units of resource, and *n* processes that use the resource. What is the maximum value of *n* for which the system will be deadlock free if the maximum requirement of each process is 3?201914m
Module 4: Deadlocks
View this question on its own page →Define deadlock. List four necessary conditions for occurrence of deadlock.
A system contains six units of resource, and n processes that use the resource. What is the maximum value of n for which the system will be deadlock free if the maximum requirement of each process is 3?
Q8a. Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.20257m
Module 4: Deadlocks
View this question on its own page →Discuss deadlock recovery techniques. Explain process termination and resource preemption methods used for recovery from deadlock.
Q9a. Write short notes on: Banker's Algorithm20227m