This course builds on the concepts from the introductory Java Concurrency course. It dives deeper into memory visibility, synchronization mechanisms, deadlocks, inter-thread communication, and introduces lock-free programming techniques. You will learn how to optimize synchronization, use advanced lock mechanisms, and prevent common concurrency issues such as deadlocks and race conditions.
Overview
Syllabus
- Unit 1: Java Memory Model and The Volatile Keyword
- Understanding Volatile Keyword in Action
- Enhancing Volatile with Multiple Threads
- From Synchronized to Volatile
- Volatile Stop Signal for Worker Thread
- Implement Volatile Temperature Monitor
- Unit 2: Optimizing Synchronization with Double-Checked Locking
- Double-Checked Locking in Action
- Optimize Logger with Double-Checked Locking
- Database Connection Singleton Task
- Implement a Singleton with Double-Checked Locking
- Unit 3: Deadlocks and Lock Mechanisms
- Safeguard Threads with Lock Order
- Fix Lock Order to Prevent Deadlock
- Advanced Locking for Safe Execution
- Convert Synchronized BankAccount to ReentrantLock
- Implement a Shared Resource Allocator Using ReentrantLock
- Unit 4: Thread Coordination with wait/notify
- Coordinating Threads with Countdown
- Coordinating Multiple Countdown Threads
- Identify the Countdown Bug
- Simulate a Parking Lot Coordination System
- Unit 5: Lock-Free Programming with Atomic Variables
- Lock-Free Operations in Java
- Add Reset and Decrement to Atomic Counter
- Convert Synchronized Inventory Management to Atomic Variables
- Ticket Booking System with Atomic Variables