Tagged articles
Happens-Before
30 articles · Page 1 of 1
This article demystifies Java's happens-before rules, showing why temporal order doesn't guarantee visibility, and how volatile combined with program order ensures a non-volatile variable's visibility across threads through a concrete code example.
ConcurrencyHappens-BeforeJMM
0 likes · 13 min read

Most hidden thread‑safety bugs in Java stem from instruction reordering and memory‑visibility issues rather than simple atomicity conflicts; this article dissects the hardware‑level reordering, JMM’s happens‑before rules, and memory‑fence mechanisms, illustrating each concept with concrete code examples and classic concurrency pitfalls.
ConcurrencyHappens-BeforeJava
0 likes · 15 min read

This article explains Java's volatile and CAS primitives, detailing volatile's visibility and ordering guarantees, the memory barriers the JVM inserts, CAS's atomic compare‑and‑swap operation, common pitfalls like the ABA problem, and how their combination enables lock‑free thread safety, with code examples and interview tips.
CASConcurrencyHappens-Before
0 likes · 9 min read

This article launches a new series on Java concurrency, explaining why concurrent programming is hard due to hardware, OS and compiler effects, detailing the Java Memory Model’s happens‑before rules, memory barriers, volatile semantics, and comparing volatile with synchronized, plus a practical double‑checked locking example.
ConcurrencyHappens-BeforeJMM
0 likes · 8 min read

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.
ConcurrencyHappens-BeforeJMM
0 likes · 20 min read

This article demystifies Java's volatile keyword by explaining how instruction reordering, CPU caches, store buffers, memory barriers, and the JVM's happens‑before rules work together to guarantee correct visibility and ordering in multithreaded programs.
CPU reorderingConcurrencyHappens-Before
0 likes · 17 min read

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

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.
ConcurrencyHappens-BeforeJMM
0 likes · 12 min read

This article reviews the Go memory model first written in 2009, highlights missing documentation for sync and sync/atomic APIs, proposes concrete textual and typed‑atomic extensions, and explains why certain compiler optimizations must remain prohibited to preserve clear, race‑free semantics.
ConcurrencyGoHappens-Before
0 likes · 24 min read

This article explains why a write to a volatile variable in Java establishes a happens‑before relationship with a subsequent read in another thread, detailing the visibility rules, ordering constraints with ordinary variables, and the transitive nature of these guarantees.
Happens-BeforeJavamemory-model
0 likes · 3 min read

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

This article thoroughly explains the low‑level implementation of Java's volatile keyword by analysing CPU multi‑level cache design, the MESI cache‑coherency protocol, the Java Memory Model, memory barriers, the happens‑before principle, and the impact on singleton patterns and synchronized blocks.
CPU cacheConcurrencyHappens-Before
0 likes · 36 min read

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

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.
ConcurrencyHappens-BeforeJSR133
0 likes · 21 min read

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-BeforeJavalock prefix
0 likes · 14 min read

This article explains the two core properties of Java's volatile keyword—visibility and ordering—how they are implemented via lock prefixes and memory barriers, compares volatile with synchronized and CAS, and details the underlying CPU cache‑coherency mechanisms such as MESI, store buffers, and invalidate queues.
ConcurrencyHappens-BeforeJava
0 likes · 13 min read


ITPUBJul 29, 2021 · Fundamentals
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

This article explains Java concurrency by examining the memory model from fundamental concepts through sequential consistency, the happens‑before relationship, and the subtle notion of causality, helping readers grasp how Java guarantees correct multithreaded behavior while allowing performance optimizations.
Happens-BeforeJMMJava
0 likes · 14 min read

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-BeforeJavaMultithreading
0 likes · 26 min read

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-BeforeJavaatomicity
0 likes · 27 min read

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

This article explains the core concepts of the Java Memory Model (JMM), compares its semantics with sequential consistency, analyzes sample code illustrating reordering and data races, and outlines synchronization and happen‑before principles that ensure correct multithreaded behavior.
Happens-BeforeJavaSynchronization
0 likes · 12 min read

This article breaks down the Java Memory Model, detailing how atomicity, visibility, and ordering work in multithreaded programs, illustrating the impact of instruction reordering, and showing how synchronized, volatile, and happens‑before rules ensure correct concurrent behavior.
ConcurrencyHappens-BeforeJava
0 likes · 13 min read

This article explains Java’s happens‑before rules, covering visibility, ordering, program order, volatile, monitor locks, start/join semantics, and provides concrete code examples to illustrate how these rules prevent common concurrency bugs.
Happens-BeforeJavamemory model
0 likes · 14 min read

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

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.
ConcurrencyHappens-BeforeJava
0 likes · 11 min read

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.
ConcurrencyHappens-BeforeJava
0 likes · 7 min read

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.
ConcurrencyHappens-BeforeJava
0 likes · 9 min read

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.
ConcurrencyHappens-BeforeJava
0 likes · 9 min read

This article explains how Java's ReentrantLock guarantees memory visibility for shared variables without using volatile, by leveraging the Java Memory Model's happens‑before guarantees, the lock's internal volatile state, and underlying CPU memory‑barrier instructions such as the LOCK prefix.
Happens-BeforeJavaReentrantLock
0 likes · 10 min read
