...
Logical-Reasoning
October 6, 2023
Reading-Comprehension
October 6, 2023
Logical-Reasoning
October 6, 2023
Reading-Comprehension
October 6, 2023

Deadlock

Question 11

Two shared resources R1 and R2 are used by processes P1 and P2. Each process has a certain priority for accessing each resource. Let Tij denote the priority of Pi for accessing Rj. A process Pi can snatch a resource Rh from process Pj if Tik is greater than Tjk. Given the following:

(I) T11 > T21
(II) T12 > T22
(III) T11 < T21
(IV) T12 < T22 

Which of the following conditions ensures that P1 and P2 can never deadlock?

A
(I) and (IV)
B
(II) and (III)
C
(I) and (II)
D
None of the above
Question 11 Explanation: 
If all resources are allocated to one process then deadlock will never occur. So, if we allocate both R1 and R2 to process P1 or both R1 and R2 to process P2 then deadlock will never occur. So when one process will complete its execution then both the resources are allocated to the other process. So, either condition (I) and (II) or (III) and (IV) ensures that deadlock will never occur.
Correct Answer: C
Question 11 Explanation: 
If all resources are allocated to one process then deadlock will never occur. So, if we allocate both R1 and R2 to process P1 or both R1 and R2 to process P2 then deadlock will never occur. So when one process will complete its execution then both the resources are allocated to the other process. So, either condition (I) and (II) or (III) and (IV) ensures that deadlock will never occur.
5 1 vote
Article Rating
Subscribe
Notify of
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
1
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!