Noninvasive concurrency with Java STM
Guy Korland1 and Nir Shavit1 and Pascal Felber2
1 Computer Science Department
Tel-Aviv University, Israel,
2 University of Neuchâtel, Neuchâtel, Switzerland,
Abstract. In this paper we present a complete Java STM framework, called Deuce,
intended as a platform for developing scalable concurrent applications and as a re-
search tool for designing new STM algorithms.
It was not clear if one could build an ecient Java STM without compiler support.
Deuce provides several benets over existing Java STM frameworks: it avoids any
changes or additions to the JVM, it does not require language extensions or intrusive
APIs, and it does not impose any memory footprint or GC overhead. To support
legacy libraries, Deuce dynamically instruments classes at load time and uses an
original eld-based locking strategy to improve concurrency. Deuce also provides
a simple internal API allowing dierent STMs algorithms to be plugged in. We show
empirical results that highlight the scalability of our framework running benchmarks
with hundreds of concurrent threads.
This paper shows for the rst time that one can actually design a Java STM with
reasonable performance without compiler support.
Multicore CPUs have become commonplace, with dual-cores powering almost any modern
portable or desktop computer, and quad-cores being the norm for new servers. While multi-
core hardware has been advancing at an accelerated pace, software for multicore platforms
seems to be at a crossroads.
Currently, two diverging programming methods are commonly used. The rst exploits
concurrency by synchronizing multiple threads based on locks. This approach is well known
to be a two-edged sword: on the one hand, locks give the programmer a ne-grained way to
control the applications critical sections, allowing an expert to provide great scalability; on
the other hand, because of the risk of deadlocks, starvation, priority inversions, etc