Tagged articles
memory barriers
19 articles · Page 1 of 1
This article explains Java memory barriers using a simple two-thread example, detailing how compiler reordering, CPU out-of-order execution, and cache inconsistency cause visibility issues, and shows how volatile and VarHandle provide acquire/release semantics to guarantee correct ordering in Java 17.
CPU reorderingConcurrencyJMM
0 likes · 9 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 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

This article deeply dissects the hardware origins of SMP multi‑core out‑of‑order execution, explains four classic memory‑reordering scenarios, and shows how Linux kernel memory barriers constrain the chaos, enabling developers to reliably reason about and fix complex multi‑core concurrency bugs.
CPUConcurrencyLinux
0 likes · 34 min read

This article demystifies lock‑free queues by explaining their low‑level implementation, atomic operations, memory barriers, and the four SPSC/MPMC models, while also covering ABA problems, false sharing avoidance, and practical C++ code examples to help developers truly understand high‑concurrency fundamentals.
C++CASConcurrency
0 likes · 44 min read

Memory barriers act like traffic signals for concurrent threads, enforcing a strict order of memory operations to prevent data races, cache incoherence, and compiler reordering, thereby ensuring program correctness and stability across multi‑core and multi‑processor systems.
CPU orderingLinux kernelMultithreading
0 likes · 37 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 explains why modern multi‑core CPUs need memory barriers, describes the different kinds of barriers (full, read, write), shows how they are implemented in the Linux kernel and hardware, and illustrates their use in multithreaded and cache‑coherent programming.
CPU architectureConcurrencycache coherence
0 likes · 41 min read

This article explains how Linux memory barriers work, why they are needed on SMP systems, the different barrier types, their kernel implementations, and practical examples showing their impact on multithreaded performance and driver development.
Cache CoherencyConcurrencyLinux
0 likes · 29 min read

This article provides a comprehensive overview of Linux memory barriers, explaining why they are needed for correct ordering of memory operations on modern multi‑core CPUs, describing the different barrier types (read, write, full), their implementation in the kernel and Java, and illustrating their use in synchronization primitives and lock‑free data structures with code examples.
CPU architectureConcurrencyLinux kernel
0 likes · 71 min read

The article explains how modern CPUs reorder instructions at compile‑time and runtime, the role of store buffers and invalid queues, why memory barriers are needed for visibility across cores, and compares sequential consistency guarantees on x86 versus ARM/Power architectures.
ARMCPUinstruction reordering
0 likes · 10 min read

This article explores the fundamentals of CPU cache hierarchy, why caches are needed, how cache inconsistency arises in multicore systems, and the mechanisms—such as cache coherence protocols, MESI, store buffers, invalidate queues, and memory barriers—that ensure correct data ordering and visibility across processors.
CPUConcurrencycache coherence
0 likes · 21 min read

This article explores the evolution from early mechanical calculators to modern CPUs, explains thread states, synchronization mechanisms, memory barriers, volatile semantics, and JVM lock implementations, and reveals why Java's notify method consistently awakens a specific waiting thread.
CASCPU architectureJVM Internals
0 likes · 39 min read

This comprehensive guide traces the evolution of computing from early mechanical calculators to today's CPUs, delving into binary systems, memory hierarchies, synchronization primitives, thread states, lock mechanisms, and Java concurrency intricacies, while providing code examples, diagrams, and interview insights for developers.
CPU architectureJava ConcurrencyLocks
0 likes · 38 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 hardware origins of CPU caches, bus locks, cache‑coherence protocols such as MESI, store buffers and memory barriers, then shows how the Java Memory Model abstracts these mechanisms and how the volatile keyword guarantees visibility and ordering while not providing atomicity.
CPU cacheJavamemory barriers
0 likes · 28 min read


JavaEdgeOct 8, 2020 · Backend Development
This article explains how the Disruptor library attains true lock‑free performance through single‑threaded writes, the use of memory barriers (volatile and happens‑before semantics), cache‑line alignment to eliminate false sharing, and a sequence‑barrier algorithm, providing code examples and practical optimization tips.
DisruptorJava Concurrencyfalse sharing
0 likes · 5 min read

This article explains the Java Memory Model, how hardware and the JVM handle memory, the eight JMM operations, instruction reordering, memory barriers, and the specific memory semantics of volatile and final variables, providing code examples and visual diagrams for clarity.
ConcurrencyFinalJava
0 likes · 12 min read

This article explains the Java volatile keyword by linking its visibility guarantees and happens‑before ordering to the underlying memory‑barrier implementation, illustrating the concepts with code examples, barrier diagrams, and a discussion of possible optimizations.
Javamemory barriersvolatile
0 likes · 8 min read
