Tagged articles
6 articles
Page 1 of 1
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.

GoGoroutineatomic
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 racemutex
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.

Memory ModelReorderingdata race
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