Skip to content

ISRO Scientist/Engineer CSE 2023Operating Systems › Process Synchronization

ISRO Scientist/Engineer CSE 2023 PYQ: In a producer-consumer scenario also known as Bounded-Buffer Problem, what would be the most appropriate…

In a producer-consumer scenario also known as Bounded-Buffer Problem, what would be the most appropriate synchronization primitive to ensure that the consumer waits when the buffer is empty?

  1. A
    Spinlock
  2. B
    Mutex lock
  3. C
    Semaphore
    Correct answer
  4. D
    Monitors

Answer

(C) Semaphore

Approach

The bounded-buffer problem requires a mechanism that can both block a process and track the number of available items. A counting semaphore naturally represents the count of empty/full slots and blocks the consumer when the count is zero, which is exactly the required behavior.

Reviewed by ISRO IQ Editorial Team.