Brian Goetz lists AtomicReference in his the book Java Concurrency in Practice in the in the section advanced topics. Yet we will see that AtomicReference are, for specific use cases, easier to use than synchronized blocks.
April 26, 2018
Atomic updates are an advanced technique, typically used in high performant concurrent data structures. So why do we need 4 classes for atomic updates in Java?
April 24, 2018
The class Phaser let you wait for a flexible amount of tasks executed in other threads. We will see how to use it by looking at a real-life example.
April 04, 2018
The CyclicBarrier let a set of threads wait till they have all reached a specific state. We will see how to use it by looking at two real-life examples.
March 29, 2018
CountDownLatch is an easy way to wait till another thread has finished a task. We will see how to use it by looking at two real-life examples.
March 21, 2018
On the example of three concurrent map implementations, we will see that we either have low scalability, the risk of deadlocks or unnecessary garbage creation.
March 13, 2018
Classes representing values should have the same properties than primitive types. In the following, we will see that those two properties are also useful for classes
March 05, 2018
Immutable classes make concurrent programming easier. In the following, we will look at how to use immutable classes for concurrent programming in Java.
February 13, 2018
Using a specialized algorithm it is possible to achieve up to four times better performance than java.util.concurrent.BlockingQueue for multiple writing and a single reading thread.
January 31, 2018
java.util.concurrent.ConcurrentHashMap is a highly optimized concurrent hash map implementation. Here are 5 tips we can learn from its implementation:
January 19, 2018
Almost every Java application uses threads. It is, therefore, necessary to write classes in a thread-safe way, which can be achieved by one of the following techniques:
January 11, 2018