The Java Source

Understanding the Java 7 Fork/Join Framework

July 13, 2011 By: Janice Heiss
An incisive and timely article by Julien Ponge, an Associate Professor in computer science at INSA de Lyon, titled “Fork and Join: Java Can Excel at Painless Parallel Programming, Too!” offers a detailed exploration of the new Java 7 fork/join framework. It begins with an explanation of low-level mechanisms involved in Java concurrent programming, then explores the rich primitives of the java.util.concurrent packages, and presents fork/join tasks plus example usage of the new APIs.

From the article itself:

“To illustrate the usage of the new fork/join framework, let us take a simple example in which we will count the occurrences of a word in a set of documents. First and foremost, fork/join tasks should operate as “pure” in-memory algorithms in which no I/O operations come into play. Also, communication between tasks through shared state should be avoided as much as possible, because that implies that locking might have to be performed. Ideally, tasks communicate only when one task forks another or when one task joins another.”

Read the complete article.

Join the discussion

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha


More on Java

Integrated Cloud Applications & Platform Services