Java Multithreading and Parallel Programming Masterclass

Video description

Multithreading is an advanced topic for any developer, and they struggle to understand many allied concepts related to it. The goal here is to make you understand in depth the multithreading concepts, applied and exemplified in Java.

The course starts with the basics of multithreading—threads, processes, concurrency, and parallelism. Then you will go through thread management concepts. After that, you will learn about thread synchronization and look at synchronization tools such as locks, wait sets and notifications, read and write locks and semaphores, barriers and phasers, and deadlocks and cache coherency enforcement. Next, you will explore tools in Java to deal with thread reusability, manage performance, choose the right parameters (tuning), and many others.

Next, you will see how to improve the runtime of a couple of known algorithms through multithreading. After that, you will study a couple of problems and their solution on Java Threading API to understand parallelism and synchronization. Finally, you will look at the connection between multithreading and widely used frameworks, such as Spring Boot, JavaRx, and JavaFX.

By the end of this course, you will understand multithreading in detail, get hands-on experience in Java, and learn to improve the performance of the app with multithreading.

What You Will Learn

  • Understand why multithreading is a real advantage for any Java developer
  • Understand the basic building blocks of multithreaded applications
  • Learn when multithreading can speed up the application and when it can’t
  • Look at the OS and hardware implications of a multithreaded application
  • Leverage and connect the concepts learned with real-world projects
  • See the connection between multithreading and widely used frameworks

Audience

This course is ideal for beginner Java developers who want to enhance their skillset by learning multithreading and parallel programming the right way.

Any developer with basic Java knowledge (including Object-Oriented Programming), who wants to improve the performance of their applications by leveraging parallel programming, and who wants to learn multithreading from scratch can gain a lot from this course.

Basic Java OOP knowledge (classes, interfaces, methods), IntelliJ IDEA, and Java 15 (JDK) are the only requirements to get started.

About The Author

Cosmin Ionita: Cosmin Ionita is a software engineer with over ten years of experience in developing enterprise-grade applications. He is based in Bucharest, Romania. He is a self-learner, truly passionate about technology, focused on gaining new skills, building outstanding professional relationships, and understanding the underlying concepts of the technologies he interacts with.

His expertise revolves around JVM-based applications and surrounding systems (or techniques) for container management, deployment workflows, monitoring and alerting, performance optimization, code quality, resource efficiency, and many others.

Table of contents

  1. Chapter 1 : Introduction to the Course
    1. Course Overview
    2. How to Get the Most Out of This Course
    3. Course Prerequisites and Code Resources
  2. Chapter 2 : General Multithreading Concepts
    1. What Is a Process?
    2. What Is a Thread?
    3. Threads Versus Processes
    4. Parallel Versus Concurrent Versus Asynchronous Versus Non-Blocking
    5. Amdahl's Law
  3. Chapter 3 : Thread Management
    1. Thread Creation
    2. Thread Priorities and States
    3. Let's Play with Thread Groups
    4. Daemon Threads and User Threads
    5. Thread Exception Handling
    6. Thread Local Variables and Race Conditions
    7. Project - Parallel Text File Processing
  4. Chapter 4 : Thread Synchronization – Part 1
    1. What Is Thread Synchronization?
    2. The Synchronized keyword
    3. Wait Sets and Notifications (Producer Consumer)
    4. Understanding Locks with Parallel Vector Sum
    5. What Are Read/Write locks and Spin Locks?
    6. Producer Consumer with Condition Variables
    7. Let's Synchronize Jobs with Semaphores
  5. Chapter 5 : Thread Synchronization – Part 2
    1. Parallel Array Search with CountDownLatch
    2. Crushing Matrixes with Barriers
    3. Parallel Array Processing with Phasers
    4. Shift Data Between Threads with Exchangers
    5. What Is a Deadlock and How Can We Avoid It?
    6. The Volatile Keyword
    7. [Project] - Simulating a MapReduce Job with Threads - Part 1
    8. [Project] - Simulating a MapReduce Job with Threads - Part 2
  6. Chapter 6 : Thread Reusability
    1. Why We Should Reuse Threads
    2. Introducing the ThreadPoolExecutor Class
    3. Work Queues for ThreadPools
    4. Handling Exceptions in ThreadPools
    5. Managing Rejected Tasks in a ThreadPool
    6. Monitoring the Performance of a ThreadPool
    7. Scheduling Tasks with ScheduledThreadPoolExecutor
    8. Let's Play with ForkJoinPools
    9. Creating Thread Pools with Executors
    10. How to Properly Size a Thread Pool
  7. Chapter 7 : Parallel Algorithms
    1. Bringing Parallelism to Quick Sort
    2. Can We Improve Binary Search Through Multithreading?
    3. Parallel Matrix Multiplication - The Naive Way
    4. Parallel Matrix Multiplication - The Optimal Way
  8. Chapter 8 : Famous Multithreading Problems
    1. Dining Philosophers Problem
    2. Readers-Writers Problem
    3. Sleeping Barber Problem
    4. No-Starve Mutex Problem
  9. Chapter 9 : Multithreading in the Real World
    1. How Can We See What's Happening Inside a JVM?
    2. Introducing Spring Boot Framework (In a Nutshell)
    3. Running Asynchronous Workloads on Spring Boot
    4. Introducing RxJava Framework (In a Nutshell)
    5. Building Parallel Data Pipelines with RxJava2
    6. Unblocking the UI Through Multithreading (With JavaFX)

Product information

  • Title: Java Multithreading and Parallel Programming Masterclass
  • Author(s): Cosmin Ionita
  • Release date: October 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781804619377