Applying Concurrency and Multi-threading to Common Java 8 Patterns
If you want to be able to write multi-threaded Java apps, this course is for you. You'll learn about problems with concurrent programming on multicore CPU, and false sharing. You'll also be introduced to the Java Memory model and more.
What you'll learn
Every developer needs to know how to write multi-threaded applications in Java. This course, Applying Concurrency and Multi-threading to Common Java 8 Patterns, is a precise presentation of all the fundamentals you'll need. You'll learn about the main problems of concurrent programming on multicore CPU, including race condition, synchronization, reentrant lock, and deadlock. Next, you'll cover how your application use is moved from the main memory to the CPU caches and how false sharing can occur. Finally, you'll be introduced to the Java Memory Model and the notion of happen-before. By the end of this course, you will understand how concurrency and multi-threading work on a variety of Java patterns and you'll be able to use this knowledge to create better apps.
Table of contents
- Introduction: What Are You Going to Learn in This Course? 2m
- Agenda: What Should You Know to Follow This Course? 2m
- Definition of a Thread, Existing Thread in Java 1m
- What Does It Mean for Tasks to Happen at the Same Time? 3m
- Happening at the Same Time on Multicore CPU 3m
- CPU Time Sharing Using a Thread Scheduler 2m
- What Is a Race Condition in Concurrent Programming? 2m
- Analysis of a Race Condition in the Singleton Pattern 3m
- Synchronizing Code to Prevent Race Conditions 3m
- Understanding the Lock Object in Synchronization 3m
- Understanding Synchronization Over Multiple Methods 4m
- What Is a Reentrant Lock? 2m
- What Is a Deadlock? 3m
- Quick Overview of the Runnable Pattern to Launch Threads 2m
- Live Coding: Launching Your First Thread 3m
- Live Coding: A Race Condition in Action, and How to Fix It 4m
- Live Coding: A Dead Lockin Action, and How to Fix It 5m
- Wrap-up of the Module 1m
- Version Check 0m
- Introduction: Agenda of the Module 2m
- Launching a Task in a New Thread with the Runnable Pattern 3m
- How to Stop a Thread Using the interrupt() Method 3m
- Implementing a First Producer/Consumer Example 2m
- A First Synchronized Version of the Producer/Consumer 3m
- What Is Needed to Fix This First, Flawed Version 2m
- Understanding How the wait() and notify() Methods Work 3m
- Fixing the Producer / Consumer Code Using Wait / Notify 1m
- Understanding How Synchronization Works with wait() and notify() 3m
- Live Coding: Unsynchronized, Flawed Producer/Consumer in Action 3m
- Live Coding: Synchronized, Flawed Producer/Consumer in Action 2m
- Live Coding: wait/notify, Correct Producer/Consumer in Action 2m
- Understanding the States of a Thread 2m
- Understanding the State Diagram of a Thread 3m
- Wrap-up on the State of a Thread 1m
- Wrap-up of the Module 1m
- Introduction: Agenda of the Module 2m
- Introduction to Visibility: Back to Our Producer/Consumer Case 2m
- Organization of Caches on Multicore CPUs 3m
- Definition of Visibility on Multicore CPUs 2m
- Understanding Why the Happens-before Link Is So Important 2m
- Definition of the Happens-before Link from the Java Memory Model 3m
- Understanding the Happens-before Link on Basic Examples 3m
- Understanding the Happens-before Link on a Complex Example 4m
- Synchronization and Volatility on Shared Variables 1m
- Understanding False Sharing on Multicore CPUs 3m
- How False Sharing Can Impact the Performance of Applications 2m
- Live Coding: Setting up a Simple Example to Observe False Sharing 3m
- Live Coding: Observing False Sharing on a Simple Example 3m
- Wrap-up of the Module 2m
- Introduction: Agenda of the Module 3m
- A First Implementation of the Singleton Pattern 2m
- Identifying the Race Condition in This First Implementation 1m
- Fixing the Race Condition Using Naive Synchronization 1m
- Analyzing the Performance on a Single Core CPU 1m
- Analyzing the Performance on a Two Core CPU 2m
- Understanding the Performance Issue of the Synchronized Singleton 2m
- Fixing the Race Condition Using Double Check Locking 2m
- Understanding the Concurrent Bug in the Double Check Locking 3m
- Possible Issues with the Double Check Locking 3m
- Fixing the Race Condition the Right Way: Using Enumeration 3m
- Live Coding: Trying to Fix the LongWrapper Example with Volatile 3m
- Live Coding: Fixing the LongWrapper Example with Synchronization 2m
- Live Coding: Presenting the Java Puzzler LockMess Case Study 4m
- Live Coding: Analyzing the Bug in the LockMess Case Study 3m
- Live Coding: Fixing the Bug in the LockMess Case Study 2m
- How to Write Correct Concurrent Code Wrap-up 2m
- Course Wrap-up and Thanks! 2m