Master Parallel Computing and Multithreading in Java

Discover Multithreading, Concurrency & Parallel programming with practical and fun examples in Java

4.50 (11 reviews)
Software Engineering
6 hours
Nov 2021
last update
regular price

What you will learn

Discover how to create responsive and high performance software.

See how to use multithreading and multiprocessing for modeling certain types of problems.

Develop programs with Java that are highly Concurrent and Parallel.

Understand the advantages, limits and properties of Parallel computing.

Improve your programming skills in Java with more advanced, mulithreading topics.

Learn about threads, processes, mutexes, barriers, waitgroups, queues, condition variables, deadlocks, spin locks and more.


The mood in the meeting on the 12th floor of an international investment bank was as bleak as it gets. The developers of the firm met to discuss the best way forward after a critical core application failed and caused a system wide outage.

"Guys, we have a serious issue here. I found out that the outage was caused by a race condition in our code, introduced a while ago and triggered last night." says Mark Adams, senior developer.

The room goes silent. The cars outside the floor to ceiling windows slowly and silently creep along in the heavy city traffic. The senior developers immediately understand the severity of the situation, realizing that they will now be working around the clock to fix the issue and sort out the mess in the datastore. The less experienced developers understand that a race condition is serious but don't know exactly what causes it and therefore keep their mouths shut.

Eventually Brian Holmes, delivery manager, breaks the silence with "The application has been running for months without any problems, we haven't released any code recently, how is it possible that the software just broke down?!"

Everyone shakes their heads and goes back to their desk leaving Brian in the room alone, puzzled. He takes out his phone and googles "race condition".

Sound familiar? How many times have you heard another developer talking about using threads and concurrent programming to solve a particular problem but out of fear you stayed out of the discussion?

Here's the little secret that senior developers will never share... Multithreading and Multiprocessing programming is not much harder than normal programming. Developers are scared of concurrent programming because they think it is an advanced topic that only highly experienced developers get to play with.

This is far from the truth. Our minds are very much used to dealing with concurrency. In fact we do this in our everyday life without any problem but somehow we struggle to translate this into our code. One of the reasons for this is that we're not familiar with the concepts and tools available to us to manage this concurrency. This course is here to help you understand how to use multithreading and multiprocessing tools and concepts to manage your parallel programming. It is designed to be as practical as possible. We start with some theory around parallelism and then explain how the operating system handles multiple processes and threads. Later we move on to explain the multiple tools available by solving example problems using concurrent programming.

In this course we use the Java language, however the concepts learned here can be applied to most programming languages.

All code in this course can be found on github, username/project: cutajarj/multithreadinginjava



Understanding Parallel Computing
More on Parallel Computing
Links and Resources for this course

Creating Threads and Processes

Processes and Threads
Threads in Java
Processes in Java

Memory Sharing between Threads

Memory Sharing
Letter count Implementation
Letter count using Memory Sharing

Thread Synchronization with Mutexes

Why do we need Synchronization?
Adding Mutexes to Letter Count
Adding Mutexes to Letter Count Implementation

Waiting for Completed tasks using Joins

Understanding Joins
File Search Example
Concurrent File Search

Synchronization using Condition Variables

Introduction to Condition Variables
Condition Variables for Wait Groups
Implementing Wait Groups with Condition Variables
Using Wait Groups

Barriers Explained

What’s a Barrier?
Example Barrier Application: Matrix Multiplication
Matrix Multiplication Implementation
Multi Threaded Matrix Multiplication with Barriers
Multi Threaded implementation with Barriers

Communication using Message passing

Thread Communication using Queues
Pipelining Example with Queues
Single Thread implementation
Multi Thread implementation

Thread Pools

Introduction to Thread Pools
Example, shoelace algorithm part 1
Example, shoelace algorithm part 2
Java's built-in thread pools
Java's Futures
Shoelace algorithm explained (optional)

Avoiding Deadlocks

Deadlocking Robots, Philosophers and Trains
Simple Deadlock Example
Train Deadlock Example Part 1
Train Deadlock Example Part 2
Solving Deadlocks using Resource Hierarchy
Implementing Resource Hierarchy Solution
Solving Deadlocks using an Arbitrator
Implementing Arbitrator Solution

Atomic Variables

Understanding Atomic Variables
Using Atomic Variables in our Example

Spinning Locks

Locking using Spinning locks
Building our own Spinning locks
Ledger Example
Implementing the Ledger Part 1
Implementing the Ledger Part 2


Master Parallel Computing and Multithreading in Java - Screenshot_01Master Parallel Computing and Multithreading in Java - Screenshot_02Master Parallel Computing and Multithreading in Java - Screenshot_03Master Parallel Computing and Multithreading in Java - Screenshot_04


January 28, 2022
Examples are good, with explanation. But there are few queries which are still not addressed such as How did you derive number of Trades during each program, what if there are 5000 treads called at same time, is there any dependencies on OS or CPU for performance. Or how to manage max capacity of CPU vs Trades Also I am trying to understand if there are multi-traded inter processing component, which is called for each client as trade (such as each Train, as thread is calling multi-traded program). What will the impact of CPU time,
November 12, 2021
I'm starting to understand what is going on in parallel computing. I have good feeling that next lessons give me more hints.



Master Parallel Computing and Multithreading in Java - Price chart


Master Parallel Computing and Multithreading in Java - Ratings chart

Enrollment distribution

Master Parallel Computing and Multithreading in Java - Distribution chart
udemy ID
course created date
course indexed date
course submited by