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.
Passionate about programming computers for over 20 years, Jose made his debut in assembler and C, C for SIMD parallel machines before adopting Java as an object-oriented language. Assistant professor in Paris North University for more than 15 years, Jose also brings his expertise to many projects, in various industrial fields.
Implementing the Producer/Consumer Pattern Using Wait / Notify Hello, my name is Jose. Welcome to the second module of this course, module called Implementing the Producer/Consumer Pattern Using Wait and Notify. What are we going to see in this module? Well, we are going to see in details the Runnable pattern, pattern in Java used to launch and stop threads. We are going to see what is the producer/consumer pattern. This pattern is very widely used. There are several solutions to implement it in Java, and we are going to see the most simple one, the one based on the Wait/Notify pattern. So we will see how to implement this producer/consumer pattern using a synchronization and the wait/notify pattern. So, let us see now the Runnable pattern. This pattern is about launching threads, and it is the first pattern introduced in Java to do this. It has been introduced in Java 1. 0, that is in the very early days of the language and it is still used nowadays, of course. There are other patterns introduced in Java 5, in the java. util. concurrent API. We are not going to see them. They are beyond the scope of this course.
Ordering Read and Writes Operations on a Multicore CPU Hello, my name is Jose, and welcome to the third module of this course, "Ordering Read and Write Operations on a Multicore CPU". Let us quickly browse through the agenda of this module. In the previous module we saw what synchronization is and how it works in Java concurrent programming. This module is about visibility. Visibility is the second fundamental notion you need to understand in Java concurrent programming. It is very closely bound to the way multicore CPUs work, so we are going to see a little about that. We are going to see something defined in the Java Language Specification which is called the "happens before" link, and we are also going to see why it is important to understand what is an "happens before" link. We will see what the special keyword "volatile" means, how it can be used and why it should be used sometimes on the declaration of fields. We will also see the side effect of the way multicore CPUs work, and namely of the way CPU calls caches are organized, which is called "false sharing", and we will see examples on some code in Java.