Forking and Joining Java to Maximize Multicore Power
With JSR-166y, Java 7 will get a new way of structuring concurrent programming known as the fork/join framework. Find out how (and when) to use it.
by Ted Neward
February 24, 2009
f writing software is hard, then writing applications that will take full advantage of the ever-more-prevalent multicore/multi-CPU hardwarewithout introducing subtle race conditions and consistency errorsis even harder. Numerous solutions have been floated for Java as well as other environments, solutions such as software transactional memory API libraries, functional languages, and even entirely new environments. However, no solution has emerged as the clear winner or even clear front-runner yet.
For its part, Sun has offered language features for structuring concurrency applications. Java 5 introduced a slew of concurrency data structures as well as behaviors and locking tools as part of the java.util.concurrent package, and Java 6 added a few more thread-safe data structures. Now Sun is set to release the first "new" approach to concurrency since the release of the Thread API in Java 1.0. Based on the work Doug Lea began back in 2000 to port a "work-stealing" mechanism to Java, this new API is known officially as JSR-166y (to distinguish it from the original JSR-166 for Java 5). To the initiated, it is colloquially called the fork/join framework.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!