The java.util.concurrent package in J2SE 5.0 provides a new thread framework for handling many of the low-level details associated with creating, executing, and managing threads. Take a closer look at its important features.
by Raghu Donepudi
March 2, 2005
f you worked with thread programming in C or C++ or prior versions of Java, you know what a headache managing the threads in your code can be. In single-threaded programs, a bug in the code causes an application to fail at the same point each and every time. In multithreaded programs, however, the failure occurs only when certain conditions are met. Because predicting all the conditions that can cause application failure is so difficult, thread programming is challenging. Some programmers avoid the challenge all together, while otherssavvy problem-solversstay glued to their computers until they get it right.
The J2SE 5.0 platform includes a new package of concurrency utilities. The classes in this package are building blocks for concurrent classes or applications used in concurrent designs. The concurrency utilities include the following:
A high-performance, flexible thread pool
A framework for asynchronous execution of tasks
A host of collection classes optimized for concurrent access
This article introduces the J2SE 5.0 framework classes and their important features. The accompanying downloadable code provides simple and easy-to-use examples that demonstrate all the new thread framework classes. Running the examples while you read the article gives you a better understanding of each feature.
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!