Mastering Threads by Dr Heinz M. Kabutz
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 s 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
Dr Heinz M. Kabutz
Dr Heinz M. Kabutz
Heinz Kabutz is the author of The Java Specialists’ Newsletter, a publication enjoyed by tens of thousands of Java experts in over 145 countries. His book “Dynamic Proxies (in German)” was #1 Bestseller on Amazon.de in Fachbücher für Informatik for about five minutes until Amazon fixed their algorithm. Thanks to a supportive mother, he has now sold 5 copies.
Heinz’s Java Specialists’ newsletter is filled with amusing anecdotes of life on the Island of Crete. He is a popular speaker at all the best Java conferences around the world, and also at some of the worst. He teaches Java courses in classrooms around the world, where his prime objective is to make absolutely sure that none of his students fall asleep. He is not always successful.
Course Curriculum
1. Mastering Threads
Copyright Notice
1. Mastering Threads (2:47)
1.1. Hearty Welcome (4:30)
Slides
Exercises
2. Basics of Threads
2. Basics of Threads (1:08)
2.1. Why Use Threads? (1:28)
2.2. Threading Models (3:06)
2.3. Parallel Computing (2:13)
2.4. Concurrent Computing (1:53)
2.5. Java Memory Model (JSR 133) (2:17)
2.6. Creating New Thread (1:44)
2.6.1. New Thread with Runnable (0:54)
2.7. ThreadGroups (3:14)
2.7.1. What Can We Do With ThreadGroups? (2:03)
2.8. Shared Memory with Multithreading (4:45)
2.9. Synchronized (9:48)
2.10. Thread States (3:35)
2.11. Inter-thread communication (5:22)
2.12. Priorities (0:53)
2.13. java.util.Timer (0:52)
2.14. Daemon Threads (0:32)
2.X. Exercise 2.1 (2:37)
2.X. Exercise 2.1 Walkthrough (10:16)
2.X. Exercise 2.2 (0:32)
2.X. Exercise 2.2 Walkthrough (2:01)
3. The Secrets of Concurrency
3. The Secrets of Concurrency (1:25)
3.1. Sabotaged Doorbell (8:18)
3.2. Distracted Spearfisherman (9:15)
3.3. Overstocked Haberdashery (9:08)
3.4. Blind Spot (4:14)
3.5. Leaked Memo (4:51)
3.6. Corrupt Politician (1:55)
3.7. Micromanager (3:03)
3.8. Cretan Driving (4:48)
3.9. Sudden Riches (3:21)
3.10. Uneaten Lutefisk (3:48)
3.X Exercise 3.1 (0:57)
3.X Exercise 3.1 Walkthrough (2:16)
3.X Exercise 3.2 (0:33)
3.X Exercise 3.2 Walkthrough (7:01)
3.X Exercise 3.3 (0:24)
3.X Exercise 3.3 Walkthrough (1:20)
4. Applied Threading Techniques
4. Applied Threading Techniques (0:22)
4.1. Executors (0:57)
4.1.1. ExecutorService (2:11)
4.1.2. Callable and Future (1:03)
4.1.3. Executor Example (5:08)
4.2. CompletionService (2:11)
4.3. CountDownLatch (1:47)
4.4. Semaphore (1:49)
4.5. BlockingQueues (1:02)
4.5.1. ArrayBlockingQueue (0:51)
4.5.2. LinkedBlockingQueue (0:39)
4.5.3. PriorityBlockingQueue (0:41)
4.5.4. DelayQueue (0:10)
4.5.5. SynchronousQueue (0:27)
4.6. Unhandled Exceptions (1:30)
4.7. ThreadLocal (1:35)
4.8. Stopping Threads (1:41)
4.9. Shutdown Hooks (2:05)
4.X. Exercise 4.1 (0:24)
4.X. Exercise 4.1 Walkthrough (3:03)
4.X. Exercise 4.2 (0:10)
4.X. Exercise 4.2 Walkthrough (1:54)
4.X. Exercise 4.3 (1:22)
4.X. Exercise 4.3 Walkthrough (1:14)
4.X. Exercise 4.4 (1:02)
4.X. Exercise 4.4 Walkthrough (4:35)
5. Threading Problems
5. Threading Problems (0:30)
5.1. Race Condition (2:33)
5.1.1. Demo of Simple Race Condition (1:37)
5.1.2. Repairing Race Condition with synchronized (3:09)
5.1.3. Repairing Race Condition with Atomics (3:20)
5.1.4. Repairing Race Condition with LongAdder (1:00)
5.1.5. Repairing Race Condition with Local Confinement and Merge (1:13)
5.1.6. Fixed with LongAdder (1:09)
5.1.7. Lazy Initialization Race Conditions (1:24)
5.1.8. How to Detect Race Conditions (0:38)
5.2. Starvation (1:03)
5.2.1. ReadWriteLock Starvation (0:57)
5.2.2. Detecting Thread Starvation (0:35)
5.2.3. Starvation in Thread Dumps (2:55)
5.3. Fairness (2:08)
5.3.1. SynchronousQueue Fairness (4:00)
5.4. Deadlock (1:14)
5.4.1. HappyLocker Example (1:00)
5.4.2. How Can We Find Deadlocks? (0:43)
5.4.3. Analyzing Thread Dumps (0:33)
5.5. Livelock (0:16)
5.5.1. Livelock with wait() and Self-Interrupt (2:04)
5.X. Exercise 5.1 (0:25)
5.X. Exercise 5.1 Walkthrough (10:37)
5.X. Exercise 5.2 (0:54)
5.X. Exercise 5.2 Walkthrough (10:20)
6. Conclusion
6. Conclusion (2:12)
Digital Download Mastering Threads by Dr Heinz M. Kabutz
The Course Is Available For Immediate Download
All These Courses Are Instant Delivery Using Our Private Server (Mega.nz, Google Drive)
- Instant Access
- Easy fast One-Click download
- No wait times and DON’T need premium accounts
- The courses are up to date and will receive ALL the updates from the creators
1. After payment, you will instant receive a link from our PRIVATE server to download all the content from the course (videos, audios, docs, pdf, screenshots, etc.)
2. You only need to click on the link, and you will have access to an online folder with the content of the course. You can download the whole course as a zip file or you can choose a specific file to download.