1.

What Is Blockingqueue In Java Concurrency?

Answer»

BlockingQueueinterface is added in Java 5 with in the java.util.concurrent package.

BlockingQueue is a queue that can block the operations. Which means BlockingQueue supports operations that wait for the queue to become non-empty when retrieving an ELEMENT, and wait for space to become AVAILABLE in the queue when storing an element.

BlockingQueue provides following blocking methods -

  • put(E e) - Inserts the specified element into this queue, waiting if NECESSARY for space to become available.
  • TAKE() - Retrieves and removes the HEAD of this queue, waiting if necessary until an element becomes available.

BlockingQueueinterface is added in Java 5 with in the java.util.concurrent package.

BlockingQueue is a queue that can block the operations. Which means BlockingQueue supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.

BlockingQueue provides following blocking methods -



Discussion

No Comment Found