Project summary |
This package is the backport of java.util.concurrent API, introduced in Java 5.0, to Java 1.4. The backport is based on public-domain sources from the JSR 166 CVS repository, and the dl.util.concurrent package. The backport is nearly complete; unsupported functionality is limited to: 1) classes that rely on explicit JVM support and cannot be emulated at a satisfactory performance level, 2) some of the functions described in the original javadoc as "designed primarily for use in monitoring in system state, not for synchronization control", or 3) functionality that would require development of substantial amount of new code. The purpose of this library is to enable gradual migration from Java 1.4 to 5.0: the library allows to develop concurrent applications for Java 1.4 that should work with Java 5.0 simply by changing package names. |
License |
This software is released to the public domain, in the spirit of the original code written by Doug Lea. The code can be used for any purpose, modified, and redistributed without acknowledgment. No warranty is provided, either express or implied. A few source files in this library originate from SUN JDK and bear SUN source code license, as stated in file headers. |
News |
Jul 4, 2005The backport, version 2.0, has been released. This major release features several new backported classes, new unit tests and stress tests, many performance improvements, and bug fixes. See the changelog, below, for more information.Feb 7, 2005The backport, version 1.1_01, has been released. New release fixes a bug affecting fair reentrant lock and several dependent classes. Additionally, starting with this version, the library is stress-tested using the "loop" tests from the JSR 166 package.Feb 7, 2005Courtesy of Doug Lea and the JSR 166 Expert Group, the Concurrency-Interest mailing list can be now used as a discussion forum for this library. When posting a comment, please clearly indicate if your message regards the backport rather than the original JSR 166 API. I suggest prefixing the subject line with "backport: ".Jan 21, 2005The backport, version 1.1, has been released. An important bug was fixed, and some new functionality was added.Dec 28, 2004The backport, version 1.0_01, has been released. A few bugs have been fixed since 1.0, and some new functionality was added.Dec 1, 2004The backport, version 1.0, has been released. |
What is supported |
The following list enumerates the functionality of java.util.concurrent that is included in this backport:
Note on package naming: since user libraries cannot define classes in
java.* packages, all the original package names have been prefixed with
|
Compatibility |
The backport, version 1.1 and above, includes some functionality of JSR 166 that did not make it for Java 5.0, but which is scheduled for addition in the next Java release. Pay attention to the "since" javadoc tags if conformance with specific Java platform versions is desired. Examples of "since 1.6" functionality include: deques, navigable maps and sets (including ConcurrentSkipList[Map,Set]), "newTaskFor" in AbstractExecutorService, "lazySet" in atomics, RunnableFuture and RunnableScheduledFuture, "allowCoreThreadTimeout" in ThreadPoolExecutor, "decorateTask" in ScheduledThreadPoolExecutor, MINUTES, HOURS, and DAYS in TimeUnit, and appropriate retrofits in collection classes. Version 2.0 of the backport have been designed to retain the link-time compatibility with the 1.1 line (i.e. it is usually safe to substitute the new JAR for the old one). However, certain incompatibilities could not be avoided:
Note: Sun JVMs prior to 1.4.2_06 have a bug (see bug ID 4917709) that makes them occassionally to crash with SIGSEGV during backport stress tests, particularly MapLoops and MapChecks. It is therefore recommended to use JVM versions 1.4.2_06 or newer when using the backport. Note: due to what is apparently a bug in SUN JVM implementations for Solaris, at least up to (and including) version 1.4.2_06, the 'ExecutorsTest.testPrivilegedThreadFactory()' unit test fails with ClassNotFoundException when launched from a class path that has backport classes stored as individual files in the "classes" directory. The problem disappears when the classes are put in a JAR file. The bug is most likely related to handling context class loaders. It is therefore advised to use JAR files instead of class files when running code that explicitly or implicitly modifies context class loaders, as does privileged thread factory. |
Robustness |
Version 2.0 of the library passes 1679 unit tests (New: 588 more than version 1.1_01) from TCK test package designed for java.util.concurrent (the tests of unsupported functionality were skipped). The following unit tests have been completed (listed in the alphabetical order): AbstractExecutorServiceTest, AbstractQueueTest, ArrayBlockingQueueTest, ArrayDequeTest, AtomicBooleanTest, AtomicIntegerArrayTest, AtomicIntegerTest, AtomicLongArrayTest, AtomicLongTest, AtomicMarkableReferenceTest, AtomicReferenceArrayTest, AtomicReferenceTest, AtomicStampedReferenceTest, ConcurrentHashMapTest, New: ConcurrentLinkedQueueTest, New: ConcurrentSkipListMapTest, New: ConcurrentSkipListSubMapTest, New: ConcurrentSkipListSetTest, New: ConcurrentSkipListSubSetTest, CopyOnWriteArrayListTest, CopyOnWriteArraySetTest, CountDownLatchTest, CyclicBarrierTest, DelayQueueTest, ExchangerTest, ExecutorsTest, ExecutorCompletionServiceTest, FutureTaskTest, LinkedBlockingDequeTest, LinkedBlockingQueueTest, New: LinkedListTest, PriorityBlockingQueueTest, PriorityQueueTest, ReentrantLockTest, ReentrantReadWriteLockTest, ScheduledExecutorTest, New: ScheduledExecutorSubclassTest, SemaphoreTest, SynchronousQueueTest, New: SystemTest (testing Utils.nanoTime()), ThreadLocalTest, ThreadPoolExecutorTest, New: ThreadPoolExecutorSubclassTest, TimeUnitTest, New: TreeMapTest, New: TreeSubMapTest, New: TreeSetTest, New: TreeSubSetTest. Starting from version 1.1_01, the backport is being stress-tested using the "loops" tests from JSR 166 (courtesy of Doug Lea and the JSR 166 Expert Group). The tests, included in the development source bundle, thoroughly evaluate behavior and performance of various types of locks, queues, maps, futures, and other API classes, under various conditions (contention etc.) and circumstances, including cancellation. In addition, it is important to emphasize that vast proportion of the backport is based on source code from JSR 166 and dl.util.concurrent, both very well tested. Whenever possible, the JSR 166 code was used. In cases when it was infeasible (e.g. for performance reasons), the dl.util.concurrent code was adapted. The new code was introduced only when absolutely necessary, e.g. to make dl.util.concurrent code conforming to JSR 166 interfaces and semantics. However, as any software, this library may still contain bugs. If you find one, please report it, or better yet, contribute a fix. |
What is NOT supported |
Change Log |
Version 2.0 (Jul 4, 2005) [CVS log]
|
Documentation and support |
For more information:
|
Related links |
Java concurrency-related Web sites: Other general-purpose utility classes for Java:
|