Tagged articles
22 articles
Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 18, 2025 · Backend Development

Master Java Concurrency: Choose ReentrantLock, ReadWriteLock, StampedLock, or Semaphore

This article explores Java’s advanced lock mechanisms—ReentrantLock, ReentrantReadWriteLock, StampedLock, and Semaphore—detailing their core features, practical code examples, and ideal usage scenarios, helping developers decide which synchronization tool best fits their performance and concurrency requirements.

JavaLocksReadWriteLock
0 likes · 9 min read
Master Java Concurrency: Choose ReentrantLock, ReadWriteLock, StampedLock, or Semaphore
Sohu Tech Products
Sohu Tech Products
Apr 29, 2025 · Backend Development

Mastering Java Concurrency: Deep Dive into Threads, Locks, and AQS

This comprehensive guide explores Java multithreading fundamentals, covering thread creation, lifecycle, synchronization challenges, context switching costs, deadlock detection, various lock mechanisms such as synchronized, ReentrantLock, ReadWriteLock, and the underlying AbstractQueuedSynchronizer architecture with practical code examples and performance tips.

AQSConditionJava
0 likes · 42 min read
Mastering Java Concurrency: Deep Dive into Threads, Locks, and AQS
Java Architecture Stack
Java Architecture Stack
Nov 14, 2024 · Backend Development

How Read‑Write Lock Separation Supercharges E‑Commerce Inventory

This article explains the read‑write lock separation design pattern, its principles, suitable scenarios such as high‑concurrency inventory queries, and provides a complete Java implementation with ReentrantReadWriteLock, including code samples, testing, performance benefits, and a discussion of its advantages and limitations.

BackendInventoryManagementJava
0 likes · 9 min read
How Read‑Write Lock Separation Supercharges E‑Commerce Inventory
FunTester
FunTester
Oct 26, 2023 · Fundamentals

Mastering Java Locks: Reentrant, Synchronized, ReadWrite, and Spin Locks Explained

This article provides a comprehensive guide to Java locking mechanisms, covering ReentrantLock, synchronized, ReadWriteLock, and spin locks, with detailed code examples, performance considerations, common use cases, and best practices to ensure thread safety, avoid deadlocks, and optimize concurrency in multithreaded applications.

JavaLocksReadWriteLock
0 likes · 17 min read
Mastering Java Locks: Reentrant, Synchronized, ReadWrite, and Spin Locks Explained
Selected Java Interview Questions
Selected Java Interview Questions
Aug 22, 2022 · Backend Development

Understanding Java synchronized and Lock Mechanisms: From Basic Locks to Advanced Optimizations

This article explains Java thread‑safety concepts, the synchronized keyword, its underlying monitor implementation, lock‑upgrade stages, JVM optimizations such as lock elimination and coarsening, and compares explicit Lock interfaces like ReentrantLock and ReadWriteLock, helping developers choose the appropriate synchronization tool.

JVMLockReadWriteLock
0 likes · 16 min read
Understanding Java synchronized and Lock Mechanisms: From Basic Locks to Advanced Optimizations
Sanyou's Java Diary
Sanyou's Java Diary
Apr 15, 2022 · Backend Development

Why Use Read‑Write Locks When Java Already Offers Thread‑Safe Collections?

This article examines the internal workings of Java's CopyOnWriteArrayList, explains why its weak consistency still necessitates read‑write locks in read‑heavy scenarios, and compares exclusive locks with read‑write locks to achieve strong data consistency without sacrificing performance.

CopyOnWriteArrayListJavaReadWriteLock
0 likes · 11 min read
Why Use Read‑Write Locks When Java Already Offers Thread‑Safe Collections?
Selected Java Interview Questions
Selected Java Interview Questions
Sep 24, 2021 · Backend Development

Understanding Java ReentrantReadWriteLock: Read‑Write Sharing and Mutual Exclusion

This article explains how Java's ReentrantReadWriteLock provides read‑write separation, allowing concurrent reads while enforcing exclusive access for writes, and demonstrates its behavior with sample code and thread‑execution results that illustrate read‑read sharing, read‑write mutual exclusion, and write‑write mutual exclusion.

JavaReadWriteLockReentrantReadWriteLock
0 likes · 5 min read
Understanding Java ReentrantReadWriteLock: Read‑Write Sharing and Mutual Exclusion
JavaEdge
JavaEdge
May 5, 2021 · Backend Development

Mastering Java ReadWriteLock: Build Efficient Caches and Avoid Concurrency Pitfalls

This article explains how Java's ReadWriteLock works, compares it with mutex locks, shows caching strategies for high‑concurrency scenarios, illustrates thread‑contention problems, and discusses lock upgrade and downgrade nuances to help developers write safe, performant backend code.

BackendJavaReadWriteLock
0 likes · 6 min read
Mastering Java ReadWriteLock: Build Efficient Caches and Avoid Concurrency Pitfalls
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Mar 29, 2021 · Databases

Implementing Distributed Read‑Write Locks with MySQL

This article explains how to build a distributed read‑write lock using MySQL tables and transactions, covering the business scenario, lock table design, detailed SQL procedures for write and read operations, logging, dead‑lock handling, and a cleanup job.

DatabaseConcurrencyDistributedLockLockTable
0 likes · 13 min read
Implementing Distributed Read‑Write Locks with MySQL
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Feb 17, 2020 · Backend Development

Understanding JVM-Level Locks in Java: synchronized, ReentrantLock, ReentrantReadWriteLock, and LongAdder

This article explains the evolution and implementation of Java's JVM‑level locks—including synchronized, ReentrantLock, ReentrantReadWriteLock, and LongAdder—detailing their lock‑upgrade process, internal object layout, AQS‑based algorithms, and how they improve concurrency and performance in multithreaded applications.

LocksReadWriteLockReentrantLock
0 likes · 24 min read
Understanding JVM-Level Locks in Java: synchronized, ReentrantLock, ReentrantReadWriteLock, and LongAdder
Big Data Technology & Architecture
Big Data Technology & Architecture
Feb 14, 2019 · Fundamentals

Java Lock Types and Their Implementation Details

This article provides a comprehensive overview of various Java lock mechanisms—including fair, non‑fair, reentrant, read/write, biased, lightweight, heavyweight, and spin locks—explaining their classifications, usage, underlying AQS implementation, and includes illustrative code snippets for each type.

AQSJavaLocks
0 likes · 22 min read
Java Lock Types and Their Implementation Details
Meituan Technology Team
Meituan Technology Team
Nov 15, 2018 · Backend Development

Understanding Java Locks: Optimistic, Pessimistic, CAS, and Various Lock Types

The article explains Java’s various lock mechanisms—including optimistic vs. pessimistic, spin and adaptive spin, no‑lock through heavyweight states, fair vs. unfair, reentrant vs. non‑reentrant, and exclusive vs. shared locks—using JDK 8 source code and practical examples to guide developers in choosing the appropriate lock for different concurrency scenarios.

CASJavaLocks
0 likes · 26 min read
Understanding Java Locks: Optimistic, Pessimistic, CAS, and Various Lock Types
Java Captain
Java Captain
Aug 17, 2018 · Fundamentals

Understanding Java ReadWriteLock: Theory, Implementation, and Usage

This article explains why read‑write locks are needed, presents a simple Java implementation, and dives into the inner workings of ReentrantReadWriteLock, covering state encoding, acquisition and release algorithms, lock downgrading, and fairness policies.

AQSJavaLock
0 likes · 18 min read
Understanding Java ReadWriteLock: Theory, Implementation, and Usage
BiCaiJia Technology Team
BiCaiJia Technology Team
Sep 9, 2017 · Backend Development

Mastering Java Concurrency: ReentrantLock, Condition, and ReadWriteLock Explained

This article demonstrates how to use Java's ReentrantLock, Condition, and ReentrantReadWriteLock classes to implement synchronization, waiting/notification, producer‑consumer patterns, and read‑write locking, providing code examples, execution results, and tips for avoiding deadlocks and improving thread coordination.

ConditionReadWriteLockReentrantLock
0 likes · 17 min read
Mastering Java Concurrency: ReentrantLock, Condition, and ReadWriteLock Explained