Fine-grained adaptive biased locking

Filip Pizlo*, Daniel Frampton, Antony L. Hosking

*Corresponding author for this work

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

    15 Citations (Scopus)

    Abstract

    Mutual-exclusion locking is the prevailing technique for protecting shared resources in concurrent programs. Fine-grained locking maximizes the opportunities for concurrent execution while preserving correctness, but increases both the number of locks and the frequency of lock operations. Adding to the frequency of these operations is the practice of using locks defensively - such as in library code designed for use in both concurrent and single-threaded scenarios. If the library does not protect itself with locks, an engineering burden is placed on the library's users; if the library does use locks, it punishes those who use it only from a single thread. Biased locking is a dynamic protocol for eliminating this trade-off, in which the underlying run-time system optimizes lock operations by biasing a lock to a specific thread when the lock is dynamically found to be thread-local. Biased locking protocols are distinguished by how many opportunities for optimization are found, and what performance trade-offs for non-local locks are experienced. Of particular concern is the relatively high cost involved in revoking the bias of a lock, which makes existing biased locking protocols susceptible to performance pathologies for programs with specific patterns of contention. This work presents the biased locking protocol used in Jikes RVM, a high-throughput Java virtual machine. The protocol, dubbed FABLE, builds on prior work by adding per-object-instance dynamic adaptation and inexpensive bias revocation. We describe the protocol, detail how it was implemented, and use it in offering the most thorough evaluation of Java locking protocols to date. FABLE is shown to provide speed-ups over traditional Java locking across a broad spectrum of benchmarks while being robust to cases previous protocols handled poorly.

    Original languageEnglish
    Title of host publicationProceedings of the 9th International Conference on the Principles and Practice of Programming in Java, PPPJ 2011
    Pages171-181
    Number of pages11
    DOIs
    Publication statusPublished - 2011
    Event9th International Conference on Principles and Practice of Programming in Java, PPPJ 2011 - Kongens Lyngby, Denmark
    Duration: 24 Aug 201126 Aug 2011

    Publication series

    NameProceedings of the 9th International Conference on the Principles and Practice of Programming in Java, PPPJ 2011

    Conference

    Conference9th International Conference on Principles and Practice of Programming in Java, PPPJ 2011
    Country/TerritoryDenmark
    CityKongens Lyngby
    Period24/08/1126/08/11

    Fingerprint

    Dive into the research topics of 'Fine-grained adaptive biased locking'. Together they form a unique fingerprint.

    Cite this