During this 4-day course, you will learn how to write safe multi-threaded Java code that performs well on your hardware. You will learn techniques to ensure visibility of your fields, to build thread safety without explicit locking. You will learn the new fork/join constructs and explore ways to parallelize your algorithms.
Please refer to Java Concurrency Content Details
Who Can Benefit
If you answer "yes!" to any of the following questions, then this course is for you:
- Has your system ever caused some strange behaviors that you could not explain? This often happens at the worst time, such as when your system is very busy. Imagine losing your biggest shopping day!
- Have you ever wondered how some of the more advanced Java constructs work, such as the ConcurrentHashMap or ConcurrentLinkedQueue?
- Would you like to find out how ReadWriteLocks can cause serious starvation?
- Have you ever programmed a web application, a servlet, a JSP page, a Swing application?
- Are you an above average Java programmer, interested to learn more?
This course is ideally suited to the professional Java programmer with at least 2 years experience, who would like to learn how to truly understand Java concurrency.
"I am extremely pleased that Dr. Heinz Kabutz has created a training course based on Java Concurrency in Practice. Everyone in the Java community appreciates Dr. Heinz' work; his deep understanding of Java -- and his passion for it -- show through in everything he does. This course is sure to be a winner." Brian Goetz, Author of Java Concurrency in Practice
- The Java Concurrency Course is the only such training officially endorsed by Brian Goetz, and is based on his best-seller book Java Concurrency in Practice. The course was written by Dr Heinz Kabutz, author of The Java Specialists' Newsletter, with contributions by Victor Grazi, author of the Java Concurrent Animated Tutorial.
History of concurrency
Benefits of threads
Risks of threads
Threads are everywhere
Annotations for Concurrency
- Class annotations
- Field and method annotations
The Java Memory
- What is a memory model, and why would I want one?
- Initialization safety
- What is thread safety?
- Guarding state with locks
- Liveness and performance
- Publication and escape
- Thread confinement
- Safe publication
- Designing a thread-safe class
- Instance confinement
- Delegating thread safety
- Adding functionality to existing thread-safe classes
- Documenting synchronization policies
- Synchronized collections
- Concurrent collections
- Blocking queues and the producer-consumer pattern
- Blocking and interruptible methods
- Building an efficient, scalable result cache
Structuring Concurrent Applications
- Executing tasks in threads
- The Executor framework
- Finding exploitable parallelism
7 Cancellation and Shutdown
- Task cancellation
- Stopping a thread-based service
- Handling abnormal thread termination
- JVM shutdown
Applying Thread Pools
- Implicit couplings between tasks and execution policies
- Sizing thread pools
- Configuring ThreadPoolExecutor
- Extending ThreadPoolExecutor
- Parallelizing recursive algorithms
- Why are some subsystems single-threaded?
- Short-running tasks
- Long-running tasks
- Shared data models
- Other forms of single-threaded subsystems
Liveness, Performance, and Testing
Avoiding Liveness Hazards
- Avoiding and diagnosing deadlocks
- Other liveness hazards
Performance and Scalability
- Thinking about performance
- Amdahl's law
- Costs introduced by threads
- Reducing lock contention
- Example: Comparing Map performance
- Reducing context switch overhead
Testing Concurrent Programs
- Testing for correctness
- Testing for performance
- Avoiding performance testing pitfalls
- Complementary testing approaches
- Lock and ReentrantLock
- Performance considerations
- Choosing between synchronized and ReentrantLock
- Read-write locks
Building Custom Synchronizers
- Managing state dependence
- Using condition queues
- Explicit condition objects
- Anatomy of a synchronizer
- AQS in java.util.concurrent synchronizer classes
Atomic Variables and Nonblocking Synchronization
- Disadvantages of locking
- Hardware support for concurrency
- Atomic variable classes
- Nonblocking algorithms
Concurrent Language Support
- Groovy parallel Framework