Machine-translated by Google. Questions are authored in English.
Top

Discussion

An operating system contains 3 user processes each requiring 2 unit of resources 'R'. The minimum number of units of 'r' such that no deadlocks will ever arise is :

  • A.3
  • B.5
  • C.4
  • D.6

Answer: C

The minimum is 4 units.

With n processes each needing at most k units, deadlock is impossible if there are at least \(n(k - 1) + 1\) units. In the worst case each process holds k - 1 units and waits for one more; one extra unit lets one process finish and release its resources.

\[ 3(2 - 1) + 1 = 4 \]

With 3 units, each process can hold one and wait forever for a second, which is a deadlock. Five or six units also avoid deadlock but are not the minimum.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.