Month: June 2019

BlockingQueue

BlockingQueue is a thread-safe queue where we can enqueue on one end of queue, and dequeue on another end of queue., All BlockingQueue implementions on array or linked queues are thread-safe implementations. Below is a simple usage of BlockingQueue.

Output:

BlockingDeque

BlockingDeque is an extended implementation of queue where we can enqueue or dequeue on both ends of the queue. All BlockingDeque implementions on array or linked queues are thread-safe implementations. Below is a simple usage of BlockingDeque

Output: