filmov
tv
Producer Consumer Pattern Using a BlockingQueue in Java

Показать описание
The BlockingQueue interface provides two methods put() and take() which are used implicitly in blocking the Producer and the Consumer thread respectively. The thread (Consumer) trying to remove item from an empty queue waits or is blocked until the Producer thread adds an item to the queue.