Tag

Atomicity

0 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Jan 1, 2025 · Backend Development

Understanding Distributed Locks and Robust Implementations with Redis

This article explains the challenges of thread synchronization in distributed systems, introduces the concept of distributed locks, compares common implementations such as Redis, Zookeeper, and databases, and provides robust Java and Lua solutions to ensure atomicity, avoid deadlocks, and support lock renewal.

AtomicityDistributed LockJava
0 likes · 14 min read
Understanding Distributed Locks and Robust Implementations with Redis
Tencent Cloud Developer
Tencent Cloud Developer
Aug 17, 2023 · Backend Development

Java Memory Model and Concurrent Programming: Visibility, Ordering, and Atomicity

The article explains how the Java Memory Model addresses concurrency challenges by defining visibility, ordering, and atomicity guarantees through mechanisms such as volatile, synchronized, cache coherence, memory barriers, CAS operations, and happens‑before relationships, enabling correct and portable multi‑threaded programming.

AtomicityCASConcurrent Programming
0 likes · 25 min read
Java Memory Model and Concurrent Programming: Visibility, Ordering, and Atomicity
FunTester
FunTester
Aug 7, 2023 · Backend Development

Atomic Operation Pitfalls in Java Performance Testing and How to Fix Them

This article describes a Java performance‑testing script that uses concurrent user initialization, explains how overlooking atomicity in thread‑safe classes caused some users to miss initialization, and presents three practical solutions such as improving stop logic, tracking completed users, and using concurrent collections.

AtomicityJavaconcurrency
0 likes · 7 min read
Atomic Operation Pitfalls in Java Performance Testing and How to Fix Them
Sanyou's Java Diary
Sanyou's Java Diary
Mar 16, 2023 · Fundamentals

Mastering Java’s volatile: Visibility, Atomicity, and Memory Barriers Explained

This article provides a comprehensive guide to Java's volatile keyword, covering its pronunciation, role in the Java Memory Model, visibility guarantees, lack of atomicity, instruction reordering prevention, memory barriers, and practical usage patterns such as double‑checked locking and atomic classes.

AtomicityJMMJava
0 likes · 20 min read
Mastering Java’s volatile: Visibility, Atomicity, and Memory Barriers Explained
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 1, 2022 · Fundamentals

Why Volatile Isn’t Enough: Mastering Atomicity and the Java Memory Model

This article explains the concept of atomicity, demonstrates atomic and non‑atomic Java code using volatile and AtomicInteger, discusses visibility, instruction reordering, the happens‑before principle, and how the JVM implements its memory model with heap and stack structures.

AtomicityJavaMemory Model
0 likes · 10 min read
Why Volatile Isn’t Enough: Mastering Atomicity and the Java Memory Model
Sohu Tech Products
Sohu Tech Products
Oct 27, 2021 · Fundamentals

Understanding Java volatile: Visibility, Atomicity, and Instruction Reordering

This article provides a comprehensive overview of Java's volatile keyword, explaining its pronunciation, role in the Java Memory Model, the three visibility guarantees, how it prevents instruction reordering, its lack of atomicity, practical code examples, and best‑practice scenarios such as double‑checked locking.

AtomicityJMMJava
0 likes · 21 min read
Understanding Java volatile: Visibility, Atomicity, and Instruction Reordering
Wukong Talks Architecture
Wukong Talks Architecture
Oct 20, 2021 · Fundamentals

Understanding Java volatile: Usage, Memory Model, Visibility, Atomicity, and Instruction Reordering

This article provides a comprehensive guide to Java's volatile keyword, covering its pronunciation, purpose, three core properties, interaction with the Java Memory Model, visibility and atomicity examples, instruction reordering, memory barriers, and practical usage such as double‑checked locking and when to prefer volatile over heavier synchronization mechanisms.

AtomicityJavaMemory Model
0 likes · 18 min read
Understanding Java volatile: Usage, Memory Model, Visibility, Atomicity, and Instruction Reordering
Wukong Talks Architecture
Wukong Talks Architecture
Aug 17, 2020 · Fundamentals

Understanding Java volatile: Visibility, Atomicity, and Instruction Reordering

This article explains the purpose and pronunciation of Java's volatile keyword, describes the Java Memory Model and its three guarantees, demonstrates how volatile ensures visibility but not atomicity, explores instruction reordering and memory barriers, and compares volatile with synchronized and other concurrency tools.

AtomicityJavaMemory Model
0 likes · 20 min read
Understanding Java volatile: Visibility, Atomicity, and Instruction Reordering
Architect
Architect
Aug 8, 2020 · Fundamentals

Understanding Java Memory Model, Volatile, Atomicity, Visibility, and Ordering

This article explains the Java memory model, how variables are stored in main and working memory, and why concurrency issues like dirty reads, non‑atomic operations, and instruction reordering occur, while detailing the roles of volatile, synchronized, locks, and atomic classes in ensuring visibility, ordering, and atomicity.

AtomicityJavaMemory Model
0 likes · 21 min read
Understanding Java Memory Model, Volatile, Atomicity, Visibility, and Ordering
Top Architect
Top Architect
Aug 8, 2020 · Backend Development

Analysis and Solutions for Redis Distributed Lock Over‑sell Incident in High‑Concurrency Seckill

This article examines a real-world over‑sell incident caused by an unsafe Redis distributed lock in a high‑traffic seckill service, analyzes the root causes such as lock expiration and non‑atomic stock checks, and presents safer lock implementations, atomic stock operations, and refactored code to prevent future overselling.

AtomicityDistributed LockJava
0 likes · 11 min read
Analysis and Solutions for Redis Distributed Lock Over‑sell Incident in High‑Concurrency Seckill
Xiaokun's Architecture Exploration Notes
Xiaokun's Architecture Exploration Notes
Jan 22, 2020 · Fundamentals

How volatile Impacts Java Threads: Experiments, JVM Modes, and Atomicity

This article demonstrates how the volatile keyword influences thread communication in Java, compares client and server JVM modes, analyzes resulting memory visibility and reordering effects, and explores atomicity limits with bytecode examples and practical recommendations.

AtomicityJVMJava
0 likes · 8 min read
How volatile Impacts Java Threads: Experiments, JVM Modes, and Atomicity
Java Captain
Java Captain
Feb 27, 2019 · Fundamentals

Understanding Java volatile: Memory Visibility, Ordering, and Interview Insights

This article explains the Java volatile keyword, covering its memory‑visibility and ordering guarantees, how it interacts with the Java Memory Model, why it does not ensure atomicity, and demonstrates typical interview‑style examples and code snippets such as flag signaling and double‑checked locking.

AtomicityJavaMemory Model
0 likes · 16 min read
Understanding Java volatile: Memory Visibility, Ordering, and Interview Insights