Java Concurrency

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...

Read More
$3,500 USD
Course Code JAV-404
Duration 4 days
Available Formats Classroom
6119 Reviews star_rate star_rate star_rate star_rate star_half
Course Image

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.

Skills Gained

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?

Prerequisites

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.

Course Details

Testimonials

"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.

Introduction

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?
  • Publication
  • Initialization safety

Fundamentals

Thread Safety

  • What is thread safety?
  • Atomicity
  • Locking
  • Guarding state with locks
  • Liveness and performance

Sharing Objects

  • Visibility
  • Publication and escape
  • Thread confinement
  • Immutability
  • Safe publication

Composing Objects

  • Designing a thread-safe class
  • Instance confinement
  • Delegating thread safety
  • Adding functionality to existing thread-safe classes
  • Documenting synchronization policies

Building Blocks

  • Synchronized collections
  • Concurrent collections
  • Blocking queues and the producer-consumer pattern
  • Blocking and interruptible methods
  • Synchronizers
  • Building an efficient, scalable result cache

Structuring Concurrent Applications

Task Execution

  • 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

Single-threaded subsystems

  • 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

  • Deadlock
  • 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

Advanced Topics

Explicit Locks

  • Lock and ReentrantLock
  • Performance considerations
  • Fairness
  • Choosing between synchronized and ReentrantLock
  • Read-write locks

Building Custom Synchronizers

  • Managing state dependence
  • Using condition queues
  • Explicit condition objects
  • Anatomy of a synchronizer
  • AbstractQueuedSynchronizer
  • 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

  • Fork/Join
  • Groovy parallel Framework
Contact Us 1-800-803-3948
Contact Us
FAQ Get immediate answers to our most frequently asked qestions. View FAQs arrow_forward