Producer-Consumer problem or bounder buffer problem
Producer-Consumer problem or bounder buffer problem:
This is a problem where two processes have a fixed size buffer. One process is producer which produces an item and put into the buffer. The other process is consuming the item from the buffer.
Solution:
The problem arises when the producer wants to put a new item in the buffer but the buffer is already full(as a limited buffer). The solution is, for the producer, has to wait until the consumer has consumed at least one buffer. Similarly, if the consumer wants to remove an item from the buffer it sees that the buffer is empty, then it goes to sleep until the producer put something in the buffer and wakes it up. So producer and consumer synchronized.
Mr. Varun Singla video tutorial
producer consumer coding
This is a problem where two processes have a fixed size buffer. One process is producer which produces an item and put into the buffer. The other process is consuming the item from the buffer.
Solution:
The problem arises when the producer wants to put a new item in the buffer but the buffer is already full(as a limited buffer). The solution is, for the producer, has to wait until the consumer has consumed at least one buffer. Similarly, if the consumer wants to remove an item from the buffer it sees that the buffer is empty, then it goes to sleep until the producer put something in the buffer and wakes it up. So producer and consumer synchronized.
Mr. Varun Singla video tutorial
producer consumer coding


Comments
Post a Comment