Tagged articles
Fair Lock
18 articles · Page 1 of 1
This article compares Java's synchronized keyword with the Lock interface (ReentrantLock), demonstrating how Lock provides finer-grained control through timeout acquisition (tryLock), interruptible locking (lockInterruptibly), fair/non-fair policies, and manual unlock in finally blocks, with code examples for each scenario.
ConcurrencyFair LockJava
0 likes · 9 min read

This article explains the parallel loading technique used in the H5 instant SDK to accelerate page startup, details the three resource‑handoff scenarios that cause synchronization challenges, reviews the early simple design and its drawbacks, and presents an optimized producer‑consumer model with fair locks and bridge streams to eliminate wasteful waiting and memory consumption.
Fair LockH5 instant SDKJava Concurrency
0 likes · 31 min read

This article provides a comprehensive guide to Redisson's distributed lock implementation, covering its architecture, comparison with Jedis and Lettuce, basic lock creation, Lua scripts for atomic operations, reentrant lock handling, watchdog-based lock renewal, RLock usage, and the design of fair locks using Redis data structures.
Distributed LockFair LockRedis
0 likes · 31 min read

The article explains Java’s ReentrantLock implementation, contrasting fair locks that queue threads in request order with non‑fair locks that allow immediate acquisition, detailing the internal Sync, FairSync and NonfairSync classes, lock/unlock mechanisms, performance trade‑offs, and guidance on selecting the appropriate lock type.
AQSFair LockJUC
0 likes · 19 min read

This article explains Redisson's distributed lock features, comparing it with Jedis and Lettuce, detailing lock acquisition, reentrancy, Lua scripts, watchdog renewal, and the implementation of fair locks using Redis lists and sorted sets, with code examples and architectural insights.
Distributed LockFair LockJava
0 likes · 30 min read

This article explains how Redisson implements distributed locks on Redis, covering basic concepts, a simple lock with Lua scripts, reentrancy handling, automatic lock renewal via WatchDog, and the advanced fair lock mechanism that ensures FIFO ordering using Redis lists and sorted sets.
Distributed LockFair LockJava
0 likes · 31 min read

This article explains how Redisson provides Redis‑based distributed locks, covering atomic lock acquisition via Lua scripts, lease time handling, watchdog auto‑extension, re‑entrant and fair locks, read‑write locks, multi‑lock batching, and the RedLock algorithm for high‑availability scenarios.
Fair LockLua ScriptRedis
0 likes · 24 min read

This article explains Redisson's role as a Java in‑memory data grid built on Redis, compares it with Jedis and Lettuce, and details how Redisson implements distributed locks—including simple lock/unlock, Lua‑based reentrant locks, automatic lock renewal (WatchDog), and a fair lock using Redis lists and sorted sets—providing complete code examples and execution flow.
Distributed LockFair LockLua
0 likes · 31 min read

This article explains the Redisson library’s distributed lock implementation in Java, covering its basic concepts, custom lock creation with Lua scripts, reentrant and fair lock mechanisms, the watchdog renewal process, and practical usage examples with code snippets.
Distributed LockFair LockLua
0 likes · 30 min read

This article explains how Redisson implements distributed locks on Redis, covering basic lock concepts, custom Lua scripts for lock acquisition and release, re‑entrant behavior, the automatic lock‑renewal watchdog, and the design of a fair lock using Redis lists and sorted sets.
Distributed LockFair LockJava
0 likes · 29 min read

This article provides a comprehensive guide to Redisson's distributed lock implementation in Java, covering its architecture, basic and reentrant lock mechanisms, fair lock using Redis lists and sorted sets, lock renewal via watchdog, and detailed code examples with Lua scripts.
Fair LockJavaRedis
0 likes · 36 min read

This article explains how Redisson implements distributed locks on Redis, covering basic concepts, differences from Jedis and Lettuce, the Lua scripts for lock acquisition, reentrancy handling, automatic lease renewal via a watchdog, Pub/Sub based unlock notifications, and the design of a fair lock using Redis lists and sorted sets.
Distributed LockFair LockRedis
0 likes · 30 min read

This article explains Redisson's in‑memory data grid features, compares it with Jedis and Lettuce, and walks through the implementation of re‑entrant, watchdog‑enabled, and fair distributed locks using Redis Lua scripts and Java code examples.
Distributed LockFair LockJava
0 likes · 31 min read

This article explains the principles of CAS, the ABA problem, and how Java's AbstractQueuedSynchronizer underpins ReentrantLock, comparing fair and non‑fair lock implementations, with code examples and discussion of their performance trade‑offs in.
AQSCASFair Lock
0 likes · 8 min read

This article explains how Curator uses Zookeeper's temporary sequential nodes to implement distributed locks, covering lock acquisition, reentrancy, fairness, read‑write semantics, batch locking, and a comparison with Redis‑based locks, while illustrating the process with code snippets and diagrams.
CuratorFair LockReentrant Lock
0 likes · 14 min read

This article explains how to achieve high availability for Canal servers by using Zookeeper to implement a distributed lock, watch mechanism, and fair scheduling, while also addressing thundering‑herd problems and illustrating common Zookeeper applications such as service registry and configuration center.
CanalDistributed LockFair Lock
0 likes · 12 min read

The article explains how a Druid 1.1.20 connection pool was throttled to ~10k RPS by fair‑locking in recycle(), and how enabling the unfair lock (setUseUnfairLock(true)) doubled single‑machine TPS, raised CPU usage to near 100 % and boosted cluster throughput by about 70 %.
ArthasDruidFair Lock
0 likes · 7 min read

This article explains the inner workings of Java's ReentrantLock, covering its API, the difference between fair and non‑fair modes, the lock acquisition and release algorithms, and how it compares to the built‑in synchronized keyword, complete with code examples and detailed analysis.
Fair Locknonfair-lock
0 likes · 10 min read
