Gkseries.com

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

Consider the following snapshot of a system running n concurrent processes. Process i is holding xi instances of a resource R, 1 ≀ i ≀ n. Assume that all instances of R are currently in use

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).

Exit mobile version