Blocking IO

Java 10

Java ArrayBlockingQueue class

ArrayBlockingQueue class is Java concurrent and bounded blocking queue implementation backed by an array. It orders elements FIFO (first-in-first-out). The head of the ArrayBlockingQueue is that element that has been on the queue the longest time. The tail of the ArrayBlockingQueue is that element that has been on the queue for the shortest time. New …

Java PriorityBlockingQueue class

Java PriorityBlockingQueue class is concurrent blocking queue data structure implementation in which objects are processed based on their priority. The “blocking” part of the name is added to imply the thread will block waiting until there’s an item available on the queue.

Producer Consumer Problem Using BlockingQueue

BlockingQueue is excellent when you want to skip the complexity involved in wait–notify statements. This BlockingQueue can be used to solve the producer-consumer problem as well as given blow example. As this problem is well known to every programmer, I am not going in detail of problem description. How BlockingQueue …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.