This course provides a deep dive into multithreading in Java, breaking down complex concepts into practical lessons. You’ll begin with the basics of threads, processes, concurrency, and parallelism before moving into thread management and synchronization using tools like locks, semaphores, and barriers. The course also covers performance tuning, thread reusability, and applying multithreading to optimize algorithms. Through real-world problems and solutions using the Java Threading API, you’ll gain hands-on experience with parallelism and synchronization. Finally, you’ll explore how multithreading integrates with popular frameworks like Spring Boot, JavaRx, and JavaFX. By the end, you’ll have the skills to apply multithreading effectively to boost application performance.
Who should take this course?
This course is designed for intermediate to advanced Java developers, software engineers, and system programmers who want to master concurrent programming, optimize performance, and build scalable, high-performing applications using multithreading and parallelism.
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
Course Outline
Introduction to the Course
Course Overview
How to Get the Most Out of This Course
Course Prerequisites and Code Resources
General Multithreading Concepts
What Is a Process?
What Is a Thread?
Threads Versus Processes
Parallel Versus Concurrent Versus Asynchronous Versus Non-Blocking
Amdahl's Law
Thread Management
Thread Creation
Thread Priorities and States
Let's Play with Thread Groups
Daemon Threads and User Threads
Thread Exception Handling
Thread Local Variables and Race Conditions
Project - Parallel Text File Processing
Thread Synchronization – Part 1
What Is Thread Synchronization?
The Synchronized keyword
Wait Sets and Notifications (Producer Consumer)
Understanding Locks with Parallel Vector Sum
What Are Read/Write locks and Spin Locks?
Producer Consumer with Condition Variables
Let's Synchronize Jobs with Semaphores
Thread Synchronization – Part 2
Parallel Array Search with CountDownLatch
Crushing Matrixes with Barriers
Parallel Array Processing with Phasers
Shift Data Between Threads with Exchangers
What Is a Deadlock and How Can We Avoid It?
The Volatile Keyword
[Project] - Simulating a MapReduce Job with Threads - Part 1
[Project] - Simulating a MapReduce Job with Threads - Part 2
Thread Reusability
Why We Should Reuse Threads
Introducing the ThreadPoolExecutor Class
Work Queues for ThreadPools
Handling Exceptions in ThreadPools
Managing Rejected Tasks in a ThreadPool
Monitoring the Performance of a ThreadPool
Scheduling Tasks with ScheduledThreadPoolExecutor
Let's Play with ForkJoinPools
Creating Thread Pools with Executors
How to Properly Size a Thread Pool
Parallel Algorithms
Bringing Parallelism to Quick Sort
Can We Improve Binary Search Through Multithreading?
Parallel Matrix Multiplication - The Naive Way
Parallel Matrix Multiplication - The Optimal Way
Famous Multithreading Problems
Dining Philosophers Problem
Readers-Writers Problem
Sleeping Barber Problem
No-Starve Mutex Problem
Multithreading in the Real World
How Can We See What's Happening Inside a JVM?
Introducing Spring Boot Framework (In a Nutshell)
Running Asynchronous Workloads on Spring Boot
Introducing RxJava Framework (In a Nutshell)
Building Parallel Data Pipelines with RxJava2
Unblocking the UI Through Multithreading (With JavaFX)