Tagged articles
JMM
44 articles · Page 1 of 1
This article explains how Java's final keyword ensures cross-thread visibility of final fields through the JMM's freeze action at constructor end, provided the this reference does not escape during construction, demonstrating with a code example that shows a race condition when this escapes and the correct behavior when final fields are properly frozen.
ConcurrencyJMMJava
0 likes · 7 min read

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

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

This article walks through ten essential Java concurrency interview topics—including the Java Memory Model, volatile semantics, synchronized lock upgrades, CAS pitfalls, AQS internals, ReentrantLock versus synchronized, ThreadPoolExecutor parameters, ThreadLocal memory‑leak issues, CountDownLatch vs CyclicBarrier, and deadlock conditions—providing code snippets, tables and detailed explanations to help candidates answer interview questions confidently.
AQSCASConcurrency
0 likes · 12 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 explains the core concepts of the Java Virtual Machine and the Java Memory Model, detailing JVM components, how bytecode is executed, and the eight happens‑before rules that govern visibility, ordering, and atomicity in multithreaded Java programs.
ConcurrencyHotSpotJMM
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 explains how the volatile keyword guarantees visibility of shared variables and prevents instruction reordering in Java, covering the Java Memory Model, memory barriers, practical code examples, and the Happens‑Before principle for reliable multithreaded programming.
JMMJavainstruction reordering
0 likes · 10 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

The article explains the Java Memory Model and its core concepts of visibility, atomicity, and ordering, detailing how volatile, synchronized, and final keywords work, the impact of CPU cache and instruction reordering, and low‑level mechanisms such as lock, cmpxchg, and false sharing.
CASConcurrencyFinal
0 likes · 20 min read

This article explores a classic Java concurrency puzzle where a non‑volatile flag causes an infinite loop, examines how modifying the loop variable from int to Integer or adding volatile affects termination, and explains the underlying JVM memory‑barrier behavior revealed by DeepSeek.
HotSpotJMMJava
0 likes · 11 min read

This article provides a comprehensive guide to Java's volatile keyword, covering its pronunciation, core features such as visibility, lack of atomicity, and instruction reordering prevention, the Java Memory Model, cache‑coherence mechanisms, practical code examples, and best‑practice scenarios like double‑checked locking and when to prefer volatile over heavier synchronization constructs.
JMMMultithreadingmemory model
0 likes · 21 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 importance and challenges of concurrent programming, details Java's memory model and synchronization primitives, analyzes a real‑world case where concurrent addAll on ArrayList caused missing UI elements, and demonstrates how using thread‑safe collections resolves the issue.
ConcurrencyJMMJava
0 likes · 14 min read

This article explains the Java volatile keyword, covering its role in guaranteeing visibility and ordering in multithreaded environments, the underlying Java Memory Model concepts of main and working memory, the eight JMM actions, and practical implementation details with illustrative examples.
JMMJavaMultithreading
0 likes · 7 min read

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.
JMMatomicityinstruction reordering
0 likes · 20 min read

The article explains Java’s concurrency mechanisms, detailing how threads communicate and synchronize via shared memory and the Java Memory Model (JMM), describing atomic actions, the MESI cache protocol, and key principles such as happens‑before, visibility, atomicity, and ordering.
ConcurrencyJMMmemory model
0 likes · 8 min read

This article explains the Java Memory Model, distinguishes main memory from thread-local memory, and demonstrates how visibility, ordering, and atomicity affect concurrent programs through code examples, volatile and synchronized keywords, double‑checked locking, and the Happens‑Before rules.
ConcurrencyJMMJava
0 likes · 18 min read

The article explains Java’s variable‑visibility problem in multithreaded code, describes the Java Memory Model and the happens‑before rules, and shows how synchronization or declaring a field volatile (as in double‑checked‑locking Singleton) guarantees that updates become visible across threads and prevents instruction reordering.
JMMJavaMultithreading
0 likes · 13 min read

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

This article compiles 16 classic Java multithreading interview questions covering high‑concurrency containers, CAS and ABA problems, volatile vs synchronized, the Java Memory Model, ThreadLocal drawbacks, AQS, thread‑pool architecture, queue types, sizing strategies, rejection policies, lifecycle management, and graceful shutdown techniques.
CASConcurrencyJMM
0 likes · 20 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 the hardware memory hierarchy, cache‑coherency issues, processor optimizations and instruction reordering, and shows how the Java Memory Model (JMM) defines eight operations to guarantee visibility, atomicity and ordering for multithreaded Java programs.
Cache CoherencyConcurrencyJMM
0 likes · 12 min read

This article provides a comprehensive tutorial on Java concurrency, covering the usage and implementation principles of the volatile and synchronized keywords, the Java Memory Model, the MESI cache protocol, common visibility and reordering issues, and practical code examples for designing efficient multithreaded solutions.
ConcurrencyJMMJava
0 likes · 17 min read

Explore deep Java concurrency concepts, from HashMap internals and its JDK7/JDK8 differences to ConcurrentHashMap’s lock strategies, thread states, memory models, volatile, CAS, synchronized, thread pools, AQS, and common interview questions, providing comprehensive insights for mastering multithreaded programming.
HashMapJMMThreadPool
0 likes · 38 min read

This article explains the differences between JVM memory layout and the Java Memory Model, clarifies how volatile and synchronized guarantee visibility, atomicity and ordering, and provides practical guidelines, code examples, and diagrams for mastering Java concurrency fundamentals.
JMMJVMJava
0 likes · 35 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 provides a comprehensive overview of Java's HashMap and ConcurrentHashMap implementations, explains core concurrency concepts such as thread states, the differences between concurrency and parallelism, memory models, volatile semantics, singleton patterns, thread pools, ThreadLocal, CAS, and the AQS framework.
ConcurrencyHashMapJMM
0 likes · 31 min read

The article thoroughly explains how CPU caches and the MESI coherence protocol interact with Java’s Memory Model, detailing the volatile keyword’s role in ensuring visibility and preventing instruction reordering, and illustrates these concepts with examples such as visibility problems and double‑checked locking.
CPU cacheConcurrencyJMM
0 likes · 22 min read

This article provides a comprehensive overview of the Java Virtual Machine, covering its runtime data areas, the Java Memory Model, heap organization, garbage‑collection algorithms, HotSpot implementation details, JVM tuning parameters, and the class‑loading mechanism.
Class LoadingJMMJVM
0 likes · 29 min read

This article provides an in‑depth overview of Java multithreading, covering fundamental concepts such as processes, threads, parallelism vs concurrency, thread creation methods, lifecycle states, synchronization mechanisms, memory model nuances, lock implementations, common pitfalls like deadlocks, and practical usage of thread pools with best‑practice recommendations.
CASConcurrencyJMM
0 likes · 39 min read

This article provides a comprehensive tutorial on Java's volatile keyword, covering its role in the Java Memory Model, the three concurrency fundamentals of atomicity, visibility, and ordering, and detailed explanations of volatile's visibility, ordering guarantees, implementation mechanisms, and a source code example.
ConcurrencyJMMJava
0 likes · 10 min read

This article explores Java’s memory model rules for final fields, detailing how writes and reads are ordered, the impact on object construction, examples with primitive and reference types, and processor-specific implementations, illustrating why final provides safe initialization without explicit synchronization.
FinalJMMJava
0 likes · 13 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 Java volatile keyword, covering its memory visibility and ordering guarantees, how it interacts with the Java Memory Model, common pitfalls such as lack of atomicity, and practical usage examples like flag signaling and double‑checked locking in concurrent programming.
ConcurrencyJMMJava
0 likes · 17 min read

This article explains why the volatile keyword is a frequent interview topic, detailing its memory‑visibility and ordering guarantees, illustrating JMM concepts with examples, comparing it to synchronized, and showing how volatile interacts with atomicity and common concurrency patterns in Java.
JMMJavamemory visibility
0 likes · 12 min read

This article walks through Java's concurrency fundamentals, covering the Java Memory Model, thread communication, atomic classes, synchronization techniques, safe object publication, and practical thread‑pool usage, while highlighting common pitfalls and performance considerations.
JMMJavaThreadPool
0 likes · 25 min read

The article explains why Java and the JVM reorder instructions for performance, the conditions that must be met, how the as‑if‑serial rule protects single‑threaded outcomes, and why the same reordering can violate happens‑before guarantees in multithreaded code, illustrated with concrete examples and code.
ConcurrencyJMMJava
0 likes · 8 min read

This article explores Java high‑concurrency concepts, detailing the Java Memory Model, thread communication, instruction reordering, atomic classes, synchronization mechanisms, lock implementations, concurrent collections, and safe object publication, providing code examples and practical guidance for building robust multithreaded applications.
JMMJavaMultithreading
0 likes · 18 min read

The article explains why Java concurrency is essential, outlines its risks, and details how thread communication and synchronization work, covering the Java Memory Model, the roles of volatile and synchronized for visibility and ordering, and illustrating these concepts with code examples.
ConcurrencyHappen-BeforeJMM
0 likes · 16 min read


21CTOOct 24, 2017 · Backend Development
This article explains essential Java concurrency concepts—including synchronous vs. asynchronous execution, concurrency vs. parallelism, critical sections, blocking and non‑blocking operations—covers thread states, creation methods, priorities, common thread APIs, and the Java Memory Model’s guarantees on atomicity, visibility, and ordering.
ConcurrencyJMMJava
0 likes · 22 min read

This article explains key Java concurrency concepts—including synchronization, parallelism, critical sections, blocking vs non‑blocking, thread lifecycle, priority, common thread methods, interrupt handling, and the Java Memory Model’s guarantees of atomicity, visibility, ordering, and happens‑before relations—providing practical examples and code snippets for backend developers.
ConcurrencyJMMJava
0 likes · 24 min read

This article provides an extensive overview of Java concurrency, covering synchronous vs asynchronous calls, critical sections, blocking and non‑blocking behavior, deadlock, starvation, livelock, concurrency levels, the Java Memory Model, atomicity, visibility, ordering, thread lifecycle, synchronization mechanisms, thread pools, and related utilities.
ConcurrencyJMMJava
0 likes · 39 min read
