Java 7 Will Evolve to Fine-grained Parallelism

Java's development team understands the multicore revolution and is working hard in offering a new concurrency framework taking into account the new possibilities offered by the new microprocessors. Hence, JDK 7 (Java Development Kit 7) will offer the fork-join framework in order to help Java developers to tackle the multicore revolution using this popular programming language.

I'm going to borrow some words from Charles Darwin's "The Origin of the Species" and his theory of evolution: "In a very real sense, nature selected the best adapted varieties to survive and to reproduce. This process has come to be known as natural selection."

I'm pretty sure that developers will select the best adapted programming languages to survive in the parallelism age. This process is also known as natural selection. Programming languages that do not evolve to support multicore programming won't have chances to survive in this new era. Luckily, JDK 7 will offer many improvements that will seduce multicore programmers.

Java supports multithreading since its first version. However, multicore microprocessors were not available when Java was born. This old threading model was useful to create more responsive applications using only one processing core, but it wasn’t prepared for high concurrency levels. This model is not suitable for multicore programming that requires many concurrent tasks taking full advantage of all the available cores.

JDK 5 added support for coarse-grained concurrency. However, this model is suitable for multiprocessor systems (MP systems). Therefore, JDK 7 adds support for fine-grained parallelism, offering the developers the possibility to exploit multicore microprocessors using the new fork-join framework.

Definitely, Java is evolving to survive the multicore revolution.
This new framework offers the possibility of working with tasks, instead of using more expensive threads. For example, the new package java.util.concurrent.forkjoin, proposed for JDK 7 release offers the following useful base classes:

* RecursiveAction: To represent divide-and-conquer solutions.
* RecursiveTask: To represent result-bearing tasks.
* AsyncAction: To work with tasks that require asynchronous completion.
* CyclicAction: To work with parallel iterative tasks.

The new fork-join tasks are designed to minimize the overhead and to improve the performance offered by compute-intensive tasks. Besides, the code is easier to understand than the old threaded version and the developers require less synchronization.

This new framework is very useful for compute-intensive tasks running on multicore CPUs.

There are many other features that will be available in JDK 7, like the new ParallelArray. However, I wanted to keep the focus on a short and simple introduction to the new fork-join framework.

Java is evolving. Thus, Java developers must also evolve to take advantage of these forthcoming features.

For more details, go here and watch the excellent slides of "Let’s Resync. Concurrency Features in JDK 7", by Brian Goetz, Sr. Staff Engineer, Sun Microsystems.

Real World Parallelism Webinar Series
  • November 17, 2009
    Visual Effects for Animation - presented by DreamWorks Animation
    Speaker: Ron Henderson (Bio)

    Ron Henderson manages the FX Tools group at DreamWorks Animation, where he is responsible for developing physical simulation and procedural modeling tools. These systems have been used for key visual effects in recent films such as Kung Fu Panda and Monsters vs. Aliens (March 2009).

    Prior to joining DreamWorks in 2002 he was a senior scientist at Caltech with a joint appointment to the Applied Math and Aeronautics departments, where he worked on efficient techniques for the direct numerical simulation of fluid turbulence.

    Abstract:
    In this webinar, Ron Henderson will show examples of visual effects, from hair and feathers to smoke and fire, from a variety of DreamWorks Animation feature films. He will discuss in general terms the kinds of techniques used to achieve particular visual effects. Finally, Henderson will show a detailed breakdown of the dam-breaking scene from Madagascar: Escape 2 Africa, demonstrating how different elements of key frame animation, simulation, and rendering are combined in a real production shot.

  • December 1, 2009
    A Quick and Easy Way to Parallelize a Legacy Codebase with Intel® Threading Building Blocks (TBBs)
    Speaker: Bernard Laberge, Avid, Senior Principal Engineer (Bio)

    Bernard Laberge is a senior principal engineer in the video editors division at Avid. During his seven years with the company he has been actively involved in the replacement of the legacy video processing engines used by Avid editors with a common hardware-abstracted, component-based video processing engine currently running on the CPU with SIMD optimized code, GPU, and dedicated hardware.

    Abstract:
    Learn how to overcome the limitations of a thread-based scheduler, including dealing with the absence of recursive parallelism support and the inefficient handling of unbalanced processing load. Bernard Laberge addresses how Avid resolved the expensive refactoring of their thread-based scheduler into a task-based solution by choosing Intel® Threading Building Blocks (TBBs). He explores how Avid was able to easily integrate the Intel TBBs into their video editor applications and more than 5 million lines of code.

  • December 15, 2009
    How to Use Intel® Parallel Studio to Streamline Code Development in a Multicore Environment
    Speaker: Matt Dunbar, Director for Performance Technology, SIMULIA (Bio)

    Matt Dunbar is the director for performance technology at SIMULIA. Since joining the company in 1993, he has worked on parallelization of the Abaqus suite of products, initially for shared memory architectures and more recently for distributed memory architectures. Dunbar has also been intimately involved in selecting both the hardware and software tools used in the development of the Abaqus product line.

    Abstract:
    Resolve elusive, costly multithreading errors quickly and efficiently with Intel® Parallel Studio. While many coding problems that lead to bugs in software applications are typically straightforward logic errors, errors in managing memory and in multithreading code can sometimes take weeks to months to diagnose and fix. Matt Dunbar explores how and why taking advantage of multicore processors through multithreaded code is critical for compute-intensive applications. While spotlighting his work on SIMULIA's Abaqus finite element solver, Dunbar addresses the need for multicore execution and shares his experiences using Intel Parallel Studio to streamline code development in a multicore environment.