Transparently reconciling transactions with locking for Java synchronization

Adam Welc*, Antony L. Hosking, Suresh Jagannathan

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

19 Citations (Scopus)

Abstract

Concurrent data accesses in high-level languages like Java and C# are typically mediated using mutual-exclusion locks. Threads use locks to guard the operations performed while the lock is held, so that the lock's guarded operations can never be interleaved with operations of other threads that are guarded by the same lock. This way both atomicity and isolation properties of a thread's guarded operations are enforced. Recent proposals recognize that these properties can also be enforced by concurrency control protocols that avoid well-known problems associated with locking, by transplanting notions of transactions found in database systems to a programming language context. While higher-level than locks, software transactions incur significant implementation overhead. This overhead cannot be easily masked when there is little contention on the operations being guarded. We show how mutual-exclusion locks and transactions can be reconciled transparently within Java's monitor abstraction. We have implemented monitors for Java that execute using locks when contention is low and switch over to transactions when concurrent attempts to enter the monitor are detected. We formally argue the correctness of our solution with respect to Java's execution semantics and provide a detailed performance evaluation for different workloads and varying levels of contention. We demonstrate that our implementation has low over-heads in the uncontended case (7% on average) and that significant performance improvements (up to 3×) can be achieved from running contended monitors transactionally.

Original languageEnglish
Title of host publicationECOOP 2006 - Object-Oriented Programming - 20th European Conference, Proceedings
PublisherSpringer Verlag
Pages148-173
Number of pages26
ISBN (Print)3540357262, 9783540357261
DOIs
Publication statusPublished - 2006
Externally publishedYes
Event20th European Conference on Object-Oriented Programming, ECOOP 2006 - Nantes, France
Duration: 3 Jul 20067 Jul 2006

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume4067 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference20th European Conference on Object-Oriented Programming, ECOOP 2006
Country/TerritoryFrance
CityNantes
Period3/07/067/07/06

Fingerprint

Dive into the research topics of 'Transparently reconciling transactions with locking for Java synchronization'. Together they form a unique fingerprint.

Cite this