in Operating System retagged by
405 views
0 votes
0 votes

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. Spinlock
  2. Mutex lock
  3. Semaphore
  4. Monitors
in Operating System retagged by
by
405 views

3 Comments

Are not Spin locks and Mutex locks one and the same?
0
0
No .
0
0
Mutex with busy waiting implementation is spinlock .
0
0

2 Answers

0 votes
0 votes
  1. Semaphore
0 votes
0 votes
Empty buffer can only be indicated by counting semaphore,mutex is used to just allow access to buffer.

Related questions