O'Reilly logo

Mastering Concurrency Programming with Java 9 - 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

Comparing the solutions

Let's compare the solutions of the serial and concurrent versions of all the methods we have implemented.

We executed the examples using the JMH framework (http://openjdk.java.net/projects/code-tools/jmh/), which allows you to implement micro benchmarks in Java. Using a framework for benchmarking is a better solution which simply measures time using methods such as currentTimeMillis() and nanoTime(). We have executed them 10 times in two different architectures:

  • A computer with an Intel Core i5-5300 CPU with Windows 7 and 16 GB of RAM: This processor has two cores and each core can execute two threads, so we will have four parallel threads.
  • A computer with an AMD A8-640 APU with Windows 10 and 8 GB of RAM: This processor ...

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