Guide to PriorityBlockingQueue in Java 1. Introduction In this article, we’ll focus on the PriorityBlockingQueue class and go over some practical examples. Starting with the assumption that we already know what a Queue is, we will first demonstrate how elements in the PriorityBlockingQueue are ordered by priority. Following this, we… Continue Reading java-priority-blocking-queue

A Guide to Java SynchronousQueue 1. Overview In this article, we’ll be looking at the SynchronousQueue from the java.util.concurrent package. Simply put, this implementation allows us to exchange information between threads in a thread-safe manner. 2. API Overview The SynchronousQueue only has two supported operations: take() and put(), and both… Continue Reading java-synchronous-queue

Guide to the Java TransferQueue 1. Overview In this article, we’ll be looking at the TransferQueue construct from the standard java.util.concurrent package. Simply put, this queue allows us to create programs according to the producer-consumer pattern, and coordinate messages passing from producers to consumers. The implementation is actually similar to… Continue Reading java-transfer-queue