Q. Consider the following snapshot of a system running π concurrent processes. Process π is holding ππ instances of a resource R, 1 β€ π β€ π. Assume that all instances of R are currently in use. Further, for all π, process π can place a request for at most ππ additional instances of R while holding the ππ instances it already has. Of the π processes, there are exactly two processes π and π such that ππ = ππ = 0. Which one of the following conditions guarantees that no other process apart from π and π can complete execution?
(A) ππ + ππ < Min {ππ | 1 β€ π β€ π , k β p, k β q}
(B) ππ + ππ < Max {ππ | 1 β€ π β€ π , k β p, k β q}
(C) Min (ππ , ππ) β₯ Min {ππ | 1 β€ π β€ π , k β p, k β q}
(D) Min (ππ, ππ) β€ Max {ππ | 1 β€ π β€ π , k β p, k β q}
Ans: XpΒ + XqΒ < Min {YkΒ β 1 β€ k β€ n, k β p, k β q}
Solution:
Xi β Holding resources for process pi,
Yi β Additional resources for process pi.
As process p and q doesnβt require any additional resources, it completes its execution and available resources are (Xp + Xq)
There are (n β 2) process pi (1< i < n, i β p, q) with their requirements as Yi (1 < i < n, i β p, q). In order to not execute process pi, no instance of Yi should be satisfied with (Xp + Xq) resources, i.e., minimum of Yi instances should be greater than (Xp + Xq).