retagged by
477 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
retagged by

2 Answers

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

Related questions

3 votes
3 votes
2 answers
1
Ramayya asked Jan 7
777 views
Which of the following heap memory allocation strategies is likely to exploit spatial locality of memory accesses in a program, the most?Best FitFirst FitNext FitLast Fit...
0 votes
0 votes
1 answer
3
Ramayya asked Jan 7
283 views
State whether true or false:Virtualization facilitates multiple OS simultaneously on the same hardwareIn dual boot, multiple OS can run simultaneously(i) True (ii) False(...
0 votes
0 votes
1 answer
4
Ramayya asked Jan 7
274 views
Any attempt by a process to access memory allocated to OS or process of other results intoTrap to OSContext SwitchingPage faultInvocation to Scheduler Despatch