Applying Concurrency and Multi-threading to Common Java Patterns

Applying Concurrency and Multi-threading to Common Java Patterns

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 2h 39m | 201 MB

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.

Every developer needs to know how to write multi-threaded applications in Java. This course, Applying Concurrency and Multi-threading to Common Java 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

Understanding Concurrency Threading and Synchronization
00 Introduction What Are You Going to Learn in This Course
01 Agenda What Should You Know to Follow This Course
02 Definition of a Thread Existing Thread in Java
03 What Does It Mean for Tasks to Happen at the Same Time
04 Happening at the Same Time on Multicore CPU
05 CPU Time Sharing Using a Thread Scheduler
06 What Is a Race Condition in Concurrent Programming
07 Analysis of a Race Condition in the Singleton Pattern
08 Synchronizing Code to Prevent Race Conditions
09 Understanding the Lock Object in Synchronization
10 Understanding Synchronization Over Multiple Methods
11 What Is a Reentrant Lock
12 What Is a Deadlock
14 Live Coding Launching Your First Thread
16 Live Coding A Dead Lockin Action and How to Fix It
17 Wrap up of the Module

Implementing the ProducerConsumer Pattern Using Wait Notify
00 Introduction Agenda of the Module
02 How to Stop a Thread Using the interrupt Method
03 Implementing a First ProducerConsumer Example
05 What Is Needed to Fix This First Flawed Version
06 Understanding How the wait and notify Methods Work
12 Understanding the States of a Thread
13 Understanding the State Diagram of a Thread
14 Wrap up on the State of a Thread
15 Wrap up of the Module

Ordering Read and Writes Operations on a Multicore CPU
00 Introduction Agenda of the Module
02 Organization of Caches on Multicore CPUs
03 Definition of Visibility on Multicore CPUs
06 Understanding the Happens before Link on Basic Examples
08 Synchronization and Volatility on Shared Variables
09 Understanding False Sharing on Multicore CPUs
12 Live Coding Observing False Sharing on a Simple Example
13 Wrap up of the Module

Implementing a Thread Safe Singleton on a Multicore CPU
00 Introduction Agenda of the Module
01 A First Implementation of the Singleton Pattern
03 Fixing the Race Condition Using Naive Synchronization
04 Analyzing the Performance on a Single Core CPU
05 Analyzing the Performance on a Two Core CPU
07 Fixing the Race Condition Using Double Check Locking
09 Possible Issues with the Double Check Locking
15 Live Coding Fixing the Bug in the LockMess Case Study
16 How to Write Correct Concurrent Code Wrap up
17 Course Wrap up and Thanks