Mastering Threads
Let's write a ThreadPool together. First exercise. A sea of scared faces. Is the teacher kidding?
"Mastering Threads" is an intense one day course that starts with the basics of threads. We then look at laws that help us to write correct threaded code. We then go to higher-level constructs that make threading much easier to use. We ends with diagnosing race conditions and deadlocks.
Each section ends with exercises that you can solve to hone your skills as a Java programmers. Some of these exercises (write a ThreadPool) has challenged hundreds of Java programmers. In solving these, we learn how inter-thread communication works. We learn how to keep our classes thread-safe. We also learn about thread states.
We have a detailed walkthrough for each exercise. Furthermore, students can submit their solved exercises to [email protected] for marking. This helps in the learning aspect as they get feedback from the instructor.
We use OpenJDK 11 for this course, taking full advantage of the new var syntax. However, programmers with Java 6 or 7 knowledge will also be able to follow.
We are selective on what we cover in this. Our intention was to create a short course that will teach you enough to help you in your every day work. Job interview questions on concurrency should not be hard after this. "Mastering Threads" is an introductory course on the topic of concurrency. For a more thorough exposition, please consider "Extreme Java - Concurrency Performance".
Diese Schulung gibt es auch auf Deutsch.
Your Instructor
Heinz Kabutz is the author of The Java Specialists’ Newsletter, a publication enjoyed by tens of thousands of Java experts in over 150 countries. He has been a Java Champion since 2005.
Course Curriculum
-
Preview2. Basics of Threads (1:08)
-
Preview2.1. Why Use Threads? (1:28)
-
Preview2.2. Threading Models (3:06)
-
Preview2.3. Parallel Computing (2:13)
-
Preview2.4. Concurrent Computing (1:53)
-
Preview2.5. Java Memory Model (JSR 133) (2:17)
-
Preview2.6. Creating New Thread (1:44)
-
Preview2.6.1. New Thread with Runnable (0:54)
-
Start2.7. ThreadGroups (3:14)
-
Start2.7.1. What Can We Do With ThreadGroups? (2:03)
-
Start2.8. Shared Memory with Multithreading (4:45)
-
Start2.9. Synchronized (9:48)
-
Start2.10. Thread States (3:35)
-
Start2.11. Inter-thread communication (5:22)
-
Start2.12. Priorities (0:53)
-
Start2.13. java.util.Timer (0:52)
-
Start2.14. Daemon Threads (0:32)
-
Start2.X. Exercise 2.1 (2:37)
-
Start2.X. Exercise 2.1 Walkthrough (10:16)
-
Start2.X. Exercise 2.2 (0:32)
-
Start2.X. Exercise 2.2 Walkthrough (2:01)
-
Start3. The Secrets of Concurrency (1:25)
-
Start3.1. Sabotaged Doorbell (8:18)
-
Start3.2. Distracted Spearfisherman (9:15)
-
Start3.3. Overstocked Haberdashery (9:08)
-
Start3.4. Blind Spot (4:14)
-
Start3.5. Leaked Memo (4:51)
-
Start3.6. Corrupt Politician (1:55)
-
Start3.7. Micromanager (3:03)
-
Start3.8. Cretan Driving (4:48)
-
Start3.9. Sudden Riches (3:21)
-
Start3.10. Uneaten Lutefisk (3:48)
-
Start3.X Exercise 3.1 (0:57)
-
Start3.X Exercise 3.1 Walkthrough (2:16)
-
Start3.X Exercise 3.2 (0:33)
-
Start3.X Exercise 3.2 Walkthrough (7:01)
-
Start3.X Exercise 3.3 (0:24)
-
Start3.X Exercise 3.3 Walkthrough (1:20)