UGC NET Paper 2 (Computer Science)Hard

In the bounded-buffer producer-consumer solution with n slots, the semaphores empty, full and mutex are initialised respectively to:

  1. A. n, 0, 1
  2. B. 0, n, 1
  3. C. 1, 0, n
  4. D. n, n, 0

Correct answer: A. n, 0, 1

empty counts free slots (n), full counts filled slots (0) and mutex is binary (1); swapping the order of waits can cause deadlock.

More UGC NET Computer Science and Applications questions

Exams that ask this topic