In the producer-consumer problem, I would like to use the
as the shared buffer.
Producer thread puts an element on the queue using the
method and the Consumer thread consumes the element on the queue using the
My question is: say if the queue is empty and the consumer thread calls the
method, I am aware that the thread is blocked until the producer puts an element on the queue. But is there something like a maximum block duration? Can I safely assume that the consumer thread will be blocked until the
I have heard people saying that there is nothing like block for ever. Is it true?