Exceptions and side-effects in atomic blocks

  • Tim Harris

Workshop on COncurrency and Synchronization in Java Programs |

Proceedings published as Memorial University of Newfoundland CS Technical Report 2004-01

In our paper at OOPSLA 2003 we discussed the design and implementation of a new atomic keyword as an extension to the Java programming language. It allows programs to perform a series of heap accesses atomically without needing to use mutual exclusion locks. We showed that data structures built using it could perform well and scale to large multi-processor systems. In this paper we extend our system in two ways. Firstly, we show how to provide an explicit ‘abort’ operation to abandon execution of an atomic block and to automatically undo any updates made within it. Secondly, we show how to perform external I/O within an atomic block. Both extensions are based on a single ‘external action’ abstraction, allowing code running within an atomic block to request that a given pre-registered operation be executed outside the block.