Race Conditions in Java Multithreading
Race conditions is a situation that can occur when two or more threads access the same variables in a way where thread scheduling may affect the final result. The two threads "race" over access to the variables. There are two primary access patterns which can cause race conditions: Check-then-act and read-modify-write. I cover both of these race conditions causes in this video. A section of code where race conditions can occur is called a critical section. To secure critical sections they must be made atomic. I show a few examples of how to do that in this video too. Race conditions in concurrent programming can easily lead to concurrency errors in your applications, so it is important to understand what race conditions is, and how to avoid it! Chapters: 0:00 Race Conditions introduction 0:54 Read-modify-write race condition example 8:06 Read-modify-write solution with atomic, synchronized block 9:47 One thread writes, one thread reads - example 13:27 Two threads that access same objects, but not write to the same objects. 16:24 Check-then-act race condition example 20:24 Check-then-act solution with atomic, synchronized block Race Conditions - text: http://tutorials.jenkov.com/java-conc... Java Concurrency tutorials - text / video: http://tutorials.jenkov.com/java-conc... • Java Concurrency and Multithreading Java Memory Model - The Basics - text / video: http://tutorials.jenkov.com/java-conc... • The Java Memory Model - The Basics Java Happens Before Guarantee - video: • Java Happens Before Guarantee - Java Memor... Java Synchronized - text / video: http://tutorials.jenkov.com/java-conc... • Java Synchronized - The synchronized keywo... Java Volatile - text / video: http://tutorials.jenkov.com/java-conc... • Java Volatile Java Lambda Expressions - text / video: http://tutorials.jenkov.com/java/lamb... • Java Lambda Expressions

Concurrency vs Parallelism

Java ConcurrentMap and ConcurrentHashMap

The 80’s Algorithm to Avoid Race Conditions (and Why It Failed)

Java Multithreading Interview 🔥 | Producer–Consumer using wait/notify & BlockingQueue @Java Techie

The Java Memory Model - The Basics

#89 Race Condition in Java

Thread Pools in Java

Java Lock

Java Synchronized - The synchronized keyword in Java and Java synchronized blocks and methods

Common Pitfalls of Rewriting Things In Rust (Cliff L. Biffle at RustWeek)

Set and HashSet in Java - Full Tutorial

Java ExecutorService - Part 1 - Introduction

Java ForkJoinPool

Java ThreadLocal

Multithreading in Java Explained in 10 Minutes

HOLY ROSARY TODAY THURSDAY, JUNE 11, 2026 ST. JUDE THADDEUS & LUMINOUS MYSTERIES | DAILY HOLY ROSARY

34. Thread Pools in Java | ThreadPoolExecutor Framework | Multithreading Part6

Java ExecutorService - Part 1

How Java Works (Explained Simply)

