Tagged articles
26 articles
Page 1 of 1
Tech Freedom Circle
Tech Freedom Circle
Apr 25, 2026 · Fundamentals

Why a Simple Singleton Answer Failed an Alibaba Interview: The Real Role of volatile, Memory Barriers, and Happens‑Before

The article dissects an Alibaba interview question about the volatile modifier, showing why answering only with a lazy‑loaded singleton is insufficient, and explains how volatile prevents instruction reordering, establishes memory barriers, and creates happens‑before relationships to make double‑checked locking safe.

Happens-beforeJMMJava
0 likes · 20 min read
Why a Simple Singleton Answer Failed an Alibaba Interview: The Real Role of volatile, Memory Barriers, and Happens‑Before
Cognitive Technology Team
Cognitive Technology Team
Jul 20, 2025 · Fundamentals

When Java volatile Falls Short: Visibility, Happens‑Before, and Performance

This article explains how Java’s volatile keyword ensures variable visibility across threads, details its full visibility and happens‑before guarantees, explores instruction reordering challenges, outlines scenarios where volatile alone is insufficient, and discusses performance considerations and alternative synchronization mechanisms.

Happens-beforeJavamemory visibility
0 likes · 14 min read
When Java volatile Falls Short: Visibility, Happens‑Before, and Performance
The Dominant Programmer
The Dominant Programmer
Jul 9, 2025 · Fundamentals

Understanding Java Memory Model (JMM): Core Concepts and Guarantees

This article explains the Java Memory Model (JMM), detailing its purpose, the distinction from JVM memory structure, the eight memory interaction operations, the happens‑before principle, memory barriers, and common pitfalls such as double‑checked locking and visibility bugs, with concrete code examples.

Happens-beforeJMMJava
0 likes · 12 min read
Understanding Java Memory Model (JMM): Core Concepts and Guarantees
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.

CASConcurrent ProgrammingHappens-before
0 likes · 25 min read
Java Memory Model and Concurrent Programming: Visibility, Ordering, and Atomicity
Zhuanzhuan Tech
Zhuanzhuan Tech
Jan 26, 2022 · Fundamentals

Understanding the Happens‑Before Principle in Java Concurrency

This article explains the Java Happens‑Before principle, detailing its rules such as program order, monitor lock, volatile variable, thread start, termination, interruption, and finalizer, and demonstrates each rule with clear code examples to illustrate visibility guarantees in concurrent programming.

Happens-beforeJavaMemory Model
0 likes · 28 min read
Understanding the Happens‑Before Principle in Java Concurrency
JD Tech
JD Tech
Nov 19, 2021 · Fundamentals

Understanding the Java Memory Model (JMM) and JSR‑133: Concepts, Guarantees, and Memory Barriers

This article explains the Java Memory Model (JMM) defined by JSR‑133, covering its core theory, the role of keywords like volatile, synchronized, and final, the underlying hardware memory models, cache‑coherence protocols, happens‑before rules, memory barriers, and how they ensure atomicity, visibility, and ordering in multithreaded Java programs.

Happens-beforeJSR133Memory Model
0 likes · 21 min read
Understanding the Java Memory Model (JMM) and JSR‑133: Concepts, Guarantees, and Memory Barriers
Java Interview Crash Guide
Java Interview Crash Guide
Aug 1, 2021 · Fundamentals

How Does Java’s volatile Keyword Ensure Visibility and Ordering?

This article explains the two core properties of Java's volatile keyword—visibility and ordering—detailing how lock prefixes, memory barriers, and happens‑before relationships provide memory consistency, and compares volatile's implementation with synchronized blocks and CAS operations.

Happens-beforeJavaMemory Model
0 likes · 14 min read
How Does Java’s volatile Keyword Ensure Visibility and Ordering?
ITPUB
ITPUB
Jul 29, 2021 · Fundamentals

Mastering Java’s Happens‑Before Principle and Memory Model

This article explains the Java Memory Model, how threads interact with main and working memory, and details the happens‑before rules—including program order, monitor, volatile, thread start, join, and transfer—to help developers understand visibility and ordering challenges in concurrent Java programs.

Happens-beforeJMMJava
0 likes · 10 min read
Mastering Java’s Happens‑Before Principle and Memory Model
High Availability Architecture
High Availability Architecture
Dec 7, 2020 · Fundamentals

Understanding the Java Memory Model: History, Definition, and Practical Implications

This article explains the evolution from single‑core to multi‑core computing, introduces memory models as a protocol for ordering memory operations, details the Java memory model’s definition, its impact on Java and other languages, and provides practical examples and insights into synchronization, volatile, and happens‑before rules.

Happens-beforeJavaMemory Model
0 likes · 26 min read
Understanding the Java Memory Model: History, Definition, and Practical Implications
Programmer DD
Programmer DD
Jul 2, 2020 · Fundamentals

Why volatile Doesn’t Guarantee Atomicity in Java and How to Use It Correctly

This article explains the Java memory model, the role of the volatile keyword in ensuring visibility and ordering, why it cannot provide atomicity for compound operations, and presents proper synchronization techniques such as synchronized, Lock, AtomicInteger, and double‑checked locking.

Happens-beforeJavaMemory Model
0 likes · 27 min read
Why volatile Doesn’t Guarantee Atomicity in Java and How to Use It Correctly
Architecture Digest
Architecture Digest
Mar 14, 2020 · Fundamentals

Understanding the Java Memory Model (JMM) and Its Concurrency Rules

This article explains the Java Memory Model, describing how main memory and thread‑local working memory interact, the eight primitive actions defined by the JVM, the special semantics of volatile, long and double variables, and how these concepts underpin atomicity, visibility and the happens‑before principle in concurrent Java programs.

Happens-beforeJMMJava
0 likes · 23 min read
Understanding the Java Memory Model (JMM) and Its Concurrency Rules
Big Data Technology & Architecture
Big Data Technology & Architecture
Feb 14, 2019 · Fundamentals

Understanding Java volatile: Memory Visibility, Lock Prefix, and Happens‑Before

This article explains the Java volatile keyword, covering its lightweight synchronization semantics, the underlying lock‑prefix implementation that forces cache line write‑backs, practical usage patterns such as state flags and double‑checked locking, and how volatile establishes a happens‑before relationship to guarantee memory visibility across threads.

Happens-beforeJVMJava
0 likes · 10 min read
Understanding Java volatile: Memory Visibility, Lock Prefix, and Happens‑Before
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jun 30, 2018 · Fundamentals

Fundamentals of the Java Memory Model and Concurrency

This article explains the core concepts of the Java Memory Model, including atomicity, visibility, ordering, instruction reordering, sequential consistency, volatile semantics, lock mechanisms, happens‑before rules, and double‑checked locking for lazy initialization.

Happens-beforeJavaMemory Model
0 likes · 11 min read
Fundamentals of the Java Memory Model and Concurrency
Programmer DD
Programmer DD
Jun 9, 2018 · Fundamentals

Unlocking Java’s Memory Model: Core Concepts and the Happens‑Before Rule

This concise summary explains the Java Memory Model’s definition of thread‑memory interaction, covering atomicity, visibility, ordering, the happens‑before principle, compiler/processor reordering constraints, and sequential consistency, while also listing key reference articles and further reading.

Happens-beforeJavaMemory Model
0 likes · 7 min read
Unlocking Java’s Memory Model: Core Concepts and the Happens‑Before Rule
Programmer DD
Programmer DD
Jun 2, 2018 · Fundamentals

Unlocking Java’s Happens‑Before: When Do Thread Changes Become Visible?

The article explains the Java Memory Model’s happens‑before principle, detailing its eight core rules, how they ensure visibility and ordering across threads, provides code examples, analyzes a non‑thread‑safe snippet, and shows how to achieve safety using locks or volatile variables.

Happens-beforeJavaMemory Model
0 likes · 9 min read
Unlocking Java’s Happens‑Before: When Do Thread Changes Become Visible?
Java Backend Technology
Java Backend Technology
Mar 17, 2018 · Backend Development

Mastering Java Memory Model: Unlocking Thread Visibility and Concurrency

This article explains Java's concurrency fundamentals, covering shared memory vs. message‑passing models, the abstract structure of the Java Memory Model, instruction reordering, write‑buffer effects, memory barriers, and the happens‑before rules that guarantee correct thread communication.

Happens-beforeJavaMemory Model
0 likes · 9 min read
Mastering Java Memory Model: Unlocking Thread Visibility and Concurrency