O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

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 and Multithreaded Programming

Concurrent programming has always been a difficult task. It might sound easy, but it is a source of many hard-to-solve problems. In this chapter, we will show you different ways of incorporating concurrency and some best practices, such as immutability, which will help in creating better, concurrent applications. We will also discuss the implementation of some commonly used patterns, such as divide-conquer and publish-subscribe, using the constructs provided by Java. We will cover the following recipes:

  • Using the basic element of concurrency - thread
  • Different synchronization approaches
  • Immutability as a means to achieve concurrency
  • Using concurrent collections
  • Using the executor service to execute ...

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