Java Concurrency Revisited: Synchronized vs. ReentrantLock

Java Concurrency in Practice is the bible of Java multi-threading. It’s dense, thorough, and frankly, a bit intimidating. For years, I relied heavily on Java’s java.util.concurrent package (ConcurrentHashMap, my beloved), ignoring the low-level mechanics underneath. Why reinvent the wheel when the standard library is so good? But to truly master scalability, you have to understand what happens under the hood. Recently, I decided to peel back the layers and revisit the building blocks of Java concurrency: synchronized and ReentrantLock. ...

November 22, 2025 · 5 min · 1018 words · Me

FLP impossibility in plain language

Overview FLP impossibility is to prove there is no algorithm can really achieve totally correct consensus in asychronous system under assumption at most one process is faulty. The paper is very famous and also difficult to understand given the wording. This article is to explain FLP impossibility in a plain way. Aschronous System In FLP paper, there are some settings/assumptions made to describe an aschronous system which is used in the proof. This system has: ...

September 16, 2023 · 7 min · 1468 words · Me

The elegant consensus algorithm - Multi-Paxos - in Java gRPC

Introduction Paxos is a distributed consensus algorithm developed by Lamport. It is proved optimal and many systems are built based on it like chubby and zookeeper. But this article is not going to discuss Lamport’s orginal paper but focus on the engineering implementations. My colleague highly recommended Ongaro’s lecture of Paxos and said it is the best source of learning Paxos. I cannot agree more after studying it. That being said, I will briefly talk about Paxos and Multi-Paxos and dive into the engineering implementations. ...

September 16, 2023 · 6 min · 1122 words · Me