Strong Atomicity for Java Without Virtual-Machine Support

Abstract

We present an implementation and evaluation of atomicity (also known as software transactions) for a dialect of Java. Our implementation is fundamentally different from prior work in three respects: (1) It is entirely a source-to-source transformation, producing Java source code that can be compiled by any Java compiler and run on any Java Virtual Machine. (2) It can enforce "strong" atomicity without assuming special hardware or a uniprocessor. (3) The implementation uses locks rather than software-transactional-memory, but it cannot deadlock and requires inter-thread communication only when there is data contention.

We evaluate our approach by qualitatively considering its overhead, quantitatively measuring the performance impact on benchmarks, and considering several difficult interactions with other language features. We conclude that it is possible to support "strong" atomicity and separate compilation, but simple whole-program optimizations improve performance significantly. In particular, a simple and effective analysis can identify fields that are never accessed in an atomic block.

pdf