Tag

Fair Lock

1 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Feb 19, 2025 · Fundamentals

Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles

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
Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles
Java Architect Essentials
Java Architect Essentials
Nov 30, 2022 · Backend Development

Understanding Redisson Distributed Locks: Architecture, Reentrancy, Fairness, and WatchDog Mechanism

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.

Fair LockJavaLua
0 likes · 31 min read
Understanding Redisson Distributed Locks: Architecture, Reentrancy, Fairness, and WatchDog Mechanism
Architect
Architect
Aug 17, 2022 · Backend Development

Understanding Redisson Distributed Locks: Reentrancy, Fairness, and Watchdog Mechanism

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.

Fair LockJavaRedis
0 likes · 29 min read
Understanding Redisson Distributed Locks: Reentrancy, Fairness, and Watchdog Mechanism
Sohu Tech Products
Sohu Tech Products
Aug 10, 2022 · Backend Development

Understanding Redisson Distributed Locks: Reentrancy, Fairness, and Watchdog Mechanism

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.

Fair LockJavaRedis
0 likes · 30 min read
Understanding Redisson Distributed Locks: Reentrancy, Fairness, and Watchdog Mechanism
IT Architects Alliance
IT Architects Alliance
Jul 19, 2022 · Fundamentals

Understanding CAS, AQS, and Fair vs Non‑Fair Locks in Java

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
Understanding CAS, AQS, and Fair vs Non‑Fair Locks in Java
Sanyou's Java Diary
Sanyou's Java Diary
Jun 12, 2022 · Backend Development

How Zookeeper’s Curator Implements Distributed Locks: A Deep Dive

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 LockJava
0 likes · 14 min read
How Zookeeper’s Curator Implements Distributed Locks: A Deep Dive
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 17, 2021 · Operations

Designing High Availability for Canal Using Zookeeper Distributed Locks

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.

CanalFair LockWatch Mechanism
0 likes · 12 min read
Designing High Availability for Canal Using Zookeeper Distributed Locks
Youzan Coder
Youzan Coder
Jul 8, 2020 · Backend Development

Druid Connection Pool Performance Optimization: Fair Lock vs Unfair Lock

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 %.

ArthasConnection PoolDatabase
0 likes · 7 min read
Druid Connection Pool Performance Optimization: Fair Lock vs Unfair Lock