Tagged articles

Data Race

8 articles · Page 1 of 1
Coder Life Journal
Coder Life Journal
Jun 17, 2026 · Fundamentals

Why HashMap Is Not Thread‑Safe: A Deep Dive into the Source Code

The article explains how HashMap can enter an infinite loop, lose data, or corrupt entries when accessed concurrently, illustrates the root causes with JDK 1.7 and 1.8 source code, compares alternative thread‑safe maps, and shows how to answer this classic interview question.

ConcurrentHashMapData RaceHashMap
0 likes · 7 min read
Why HashMap Is Not Thread‑Safe: A Deep Dive into the Source Code
TonyBai
TonyBai
Mar 16, 2026 · Fundamentals

Does Go Really Eliminate Undefined Behavior? An In‑Depth Investigation

The article examines Go’s claim of eradicating undefined behavior, showing that while the language defines many formerly UB cases such as integer overflow and out‑of‑bounds access, it still harbors UB in concurrent data races, interface type confusion, and certain unspecified behaviors.

Data RaceGoSPEC
0 likes · 18 min read
Does Go Really Eliminate Undefined Behavior? An In‑Depth Investigation
BirdNest Tech Talk
BirdNest Tech Talk
Jan 15, 2025 · Backend Development

Data Race vs Race Condition in Go: Clear Differences and How to Fix Them

The article explains the distinction between a data race—simultaneous unsynchronized memory access by goroutines—and a race condition—logic errors caused by timing dependencies—using Go code examples, demonstrates how to reproduce each issue, and shows how mutexes or atomic operations can resolve them.

Data RaceGoatomic
0 likes · 5 min read
Data Race vs Race Condition in Go: Clear Differences and How to Fix Them
IT Services Circle
IT Services Circle
Jan 4, 2025 · Backend Development

Is std::cout Thread‑Safe? Understanding Data Races, Race Conditions, and Practical Solutions in C++

This article examines whether std::cout is thread‑safe, explains the concepts of data race and race condition, demonstrates how interleaved output can occur in multithreaded C++ programs, and presents several solutions—including mutexes, custom wrappers, and C++20 std::osyncstream—to ensure orderly output.

C++Data RaceThread Safety
0 likes · 10 min read
Is std::cout Thread‑Safe? Understanding Data Races, Race Conditions, and Practical Solutions in C++
Xiaokun's Architecture Exploration Notes
Xiaokun's Architecture Exploration Notes
Jan 23, 2020 · Fundamentals

Understanding the Java Memory Model: Data Sharing, Race Conditions, and Visibility Solutions

This article explains the Java Memory Model, covering how it validates reads, the distinction between shared and exclusive memory areas, data‑race scenarios with example code, visibility challenges, and the JMM‑based solutions such as volatile, synchronized, and memory barriers to prevent harmful reordering.

Data RaceJavaMemory Model
0 likes · 8 min read
Understanding the Java Memory Model: Data Sharing, Race Conditions, and Visibility Solutions
360 Tech Engineering
360 Tech Engineering
Jul 4, 2018 · Backend Development

Understanding and Avoiding Common Concurrency Bugs in Java

This article introduces the four major categories of multithreaded bugs—data races, atomicity failures, ordering failures, and deadlocks—explains their causes with Java examples, and provides practical techniques such as using state machines, volatile variables, consistent lock ordering, and proper exception handling to prevent them.

Data RaceDeadlockJava
0 likes · 7 min read
Understanding and Avoiding Common Concurrency Bugs in Java