O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Concurrent Programming Design

In this chapter, we will cover the following topics:

  • Using immutable objects when possible
  • Avoiding deadlocks by ordering locks
  • Using atomic variables instead of synchronization
  • Holding locks for as short time as possible
  • Delegating the management of threads to executors
  • Using concurrent data structures instead of programming yourselves
  • Taking precautions using lazy initialization
  • Using the fork/join framework instead of executors
  • Avoiding the use of blocking operations inside a lock
  • Avoiding the use of deprecated methods
  • Using executors instead of thread groups
  • Using streams to process big data sets
  • Other tips and tricks

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required