Home

Awesome

High Scale Lib

This is Boundary's fork of Cliff Click's high scale lib. We will be maintaining this fork with bug fixes, improvements and versioned builds in maven central.

To use high scale lib from ivy declare the dependency in ivy.xml:

<dependency
  org="com.boundary"
  name="high-scale-lib"
  rev="1.0.3" />

From maven simply add the dependency to the dependencies element:

<dependency>
  <groupId>com.boundary</groupId>
  <artifactId>high-scale-lib</artifactId>
  <version>1.0.6</version>
</dependency>

Original README

IF YOU ARE LOOKING for the drop-in replacement for java.util.Hashtable, it's in the lib directory, lib/java_util_hashtable.jar. It needs to be in your bootclasspath. Example:

java -Xbootclasspath/p:lib/java_util_hashtable.jar my_java_app_goes_here

A collection of Concurrent and Highly Scalable Utilities. These are intended as direct replacements for the java.util.* or java.util.concurrent.* collections but with better performance when many CPUs are using the collection concurrently. Single-threaded performance may be slightly lower.

The direct replacements match the API - but not all behaviors are covered by the API, and so they may not work for your program. In particular, the replacement for java.util.Hashtable is NOT synchronized (that is the point!), although it is multi-threaded safe. If you rely on the undocumented synchronization behavior of the JDK Hashtable, your program may not work. Similarly, the iteration order is different between this version and the JDK version (this exact issue broke the SpecJBB benchmark when the iteration order was changed slightly (via using a slightly different hash function) between JDK rev's).

If you want to drop-in the non-blocking versions of Hashtable, HashMap or ConcurrentHashMap, you'll need to alter your bootclasspath - these classes come directly from your JDK and so are found via the System loader before any class-path hacks can be done.

To replace the JDK implementation of Hashtable with a non-blocking version of Hashtable, add java_util_hashtable.jar to your java launch line:

java -Xbootclasspath/p:lib/java_util_hashtable.jar my_app_goes_here

Similarly for ConcurrentHashMap, add java_util_concurrent_chm.jar:

java -Xbootclasspath/p:lib/java_util_concurrent_chm.jar my_app_goes_here

The other utilities do not have direct JDK replacements; you need to call them out directly and place high_scale_lib.jar in your classpath:

Cliff Click