Tag

Data Race

0 views collected around this technical thread.

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.

CData 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.

ConcurrencyData RaceJava
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.

ConcurrencyData RaceJava
0 likes · 7 min read
Understanding and Avoiding Common Concurrency Bugs in Java