O'Reilly logo

Java 7 New Features Cookbook by Jennifer L. Reese, Richard M. Reese

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

Chapter 10. Concurrent Processing

In this chapter, we will cover the following:

  • Using join/fork framework in Java 7

  • Using the reusable synchronization barrier Phaser

  • Using the ConcurrentLinkedDeque class safely with multiple threads

  • Using the LinkedTransferQueue class

  • Supporting multiple threads using the ThreadLocalRandom class

Introduction

Support for concurrent applications has been improved in Java 7. Several new classes have been introduced that support the parallel execution of tasks. The ForkJoinPool class is used for applications, which use the divide-and-conquer technique to solve a problem. Each subproblem is forked (split) as a separate thread and later joined, if necessary to provide a solution. The threads used by this class are normally ...

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