Both Stack and Queue are two of the crucial data structure which is very
useful in solving a lot of problems. They are not as fundamental data
structures as an
array or linked lists but they offer some unique advantages in terms of how you store and access
elements. Stack is commonly known as
LIFO data structure because the last element you put is the first one
to come out while Queue is known as FIFO data structure. The
elements are retrieved from the queue in the order they were inserted. Both
of these data structure has several usages and are used to solve many common
problems and to implement algorithms.
Thursday, July 3, 2025
Saturday, April 22, 2023
How to use ConcurrentLinkedDeque in Java? Example Tutorial
Hello guys, ConcurrentLinkedDeque is another amazing class from Java's concurrent collection package which can be used as high-performance, thread-safe and non-blocking data structure. As the name suggest, its a Deque which means its allows you to operate at both ends of queue. You can insert at one end and consume from other end. It's also concurrent and thread-safe which means multiple threads can operate on same queue at the same time. You can have multiple producer threads which are inserting data into the queue and multiple consumer threads which are consuming data from this data structure. Before going to discuss this topic, let me inform you that this article is in continuation of our deque article series. It's totally not mandatory to go through those articles, but it is highly recommended as they all play a part in the understanding of today's topic.
Labels:
concurrency
,
concurrent collections
,
java collection tutorial
,
queue
Subscribe to:
Posts
(
Atom
)