ConcurrentLinkedDeque in Java With Examples

ConcurrentLinkedDeque in Java is an unbounded concurrent deque which is thread-safe. It stores its elements as linked nodes where each node stores a reference to both previous and next nodes. ConcurrentLinkedDeque in Java implements Deque interface and is part of java.util.concurrent package. How ConcurrentLinkedDeque differs from the blocking Deque implementations…

Continue reading

Java CopyOnWriteArraySet With Examples

CopyOnWriteArraySet in Java extends the AbstractSet which in turn implements the Set interface and is part of java.util.concurrent package. How CopyOnWriteArraySet differs from other Set implementations in Java Collections framework is that it is thread-safe. Table of contents CopyOnWriteArraySet internal implementation in Java Features of the CopyOnWriteArraySet Java CopyOnWriteArraySet constructors…

Continue reading

Java ConcurrentSkipListMap With Examples

This post talks about the ConcurrentSkipListMap class from the java.util.concurrent package and the interface ConcurrentNavigableMap this class implements. ConcurrentSkipListMap in Java ConcurrentSkipListMap is a thread-safe, scalable Map that stores its elements in sorted manner. By default map is sorted according to the natural ordering of its keys, or by a…

Continue reading

LinkedBlockingQueue in Java With Examples

LinkedBlockingQueue in Java is an implementation of BlockingQueue interface and is part of java.util.concurrent package. LinkedBlockingQueue has the features of both ArrayBlockingQueue and DelayQueue. ArrayBlockingQueue is a bounded blocking queue where as DelayQueue is an unbounded blocking queue. LinkedBlockingQueue sits in the middle as it is an optionally-bounded blocking queue…

Continue reading

ConcurrentLinkedQueue in Java With Examples

ConcurrentLinkedQueue in Java is an unbounded queue which is thread-safe. It stores its elements as linked nodes where each node stores a reference to the next node. ConcurrentLinkedQueue class implements Queue interface and is part of java.util.concurrent package. How ConcurrentLinkedQueue differs from the BlockingQueue implementations like ArrayBlockingQueue, PriorityBlockingQueue is that…

Continue reading