Skip to main content
QUICK REVIEW

[Paper Review] BRAVO—Biased Locking for Reader-Writer Locks

David Dice, Alex Kogan|arXiv (Cornell University)|Oct 3, 2018
Parallel Computing and Optimization TechniquesComputer Science1 citations
TL;DR

BRAVO is a lightweight transformation that enhances existing reader-writer locks by adding two integer fields, enabling scalable reader concurrency through a shared, NUMA-friendly visible readers table. By hashing thread identities to distribute reader presence across the table, BRAVO reduces cache coherence traffic and maintains compact lock size, achieving high scalability under read-dominated workloads with minimal footprint increase.

ABSTRACT

Designers of modern reader-writer locks confront a difficult trade-off related to scalability. Locks that have a compact memory representation for active readers will typically suffer under high intensity read-dominated workloads when the reader indicator' state is updated frequently by a diverse set of threads, causing cache invalidation and coherence traffic. Other designs, such as cohort reader-writer locks, use distributed indicators, one per NUMA node. This improves reader-reader scalability, but also increases the size of each lock instance. We propose a simple transformation BRAVO, that augments any existing reader-writer lock, adding just two integer fields to the lock instance. Readers make their presence known to writers by hashing their thread's identity with the lock address, forming an index into a visible readers table. Readers attempt to install the lock address into that element in the table, making their existence known to potential writers. All locks and threads in an address space can share the visible readers table. Updates by readers tend to be diffused over the table, resulting in a NUMA-friendly design. Crucially, readers of the same lock tend to write to different locations in the array, reducing coherence traffic. Specifically, BRAVO allows a simple compact lock to be augmented so as to provide scalable concurrent reading but with only a modest increase in footprint.

Motivation & Objective

  • Address the scalability bottleneck in reader-writer locks under high-intensity, read-dominated workloads due to frequent cache line invalidation from reader state updates.
  • Overcome the trade-off between compact memory representation and reader-reader scalability in traditional locks.
  • Enable existing reader-writer locks to scale efficiently under concurrent reads without increasing lock size significantly.
  • Minimize coherence traffic by distributing reader presence updates across a shared table using thread identity hashing.
  • Design a solution that is both simple and compatible with existing lock implementations, requiring only two additional integer fields.

Proposed method

  • Augment any existing reader-writer lock with two integer fields: a lock-specific index and a reader count.
  • Use a global, shared visible readers table where each entry corresponds to a lock address and tracks active readers via thread identity hashing.
  • Hash each reader’s thread ID with the lock’s address to compute an index into the visible readers table, distributing updates across the array.
  • Allow readers to atomically attempt to install the lock address into their computed table entry, signaling presence to writers.
  • Ensure all locks and threads in the address space share the same visible readers table, enabling cross-lock coordination with minimal overhead.
  • Leverage the hashing mechanism to reduce contention and cache line sharing among readers of the same lock, improving NUMA locality.

Experimental results

Research questions

  • RQ1Can a compact reader-writer lock be enhanced to support scalable concurrent reading without significantly increasing its memory footprint?
  • RQ2Does distributing reader presence updates across a shared table reduce cache coherence traffic compared to centralized reader state management?
  • RQ3To what extent does thread identity hashing improve load distribution and reduce contention in the readers table?
  • RQ4How does BRAVO perform under high-intensity, read-dominated workloads compared to traditional and cohort-based reader-writer locks?
  • RQ5Can BRAVO be applied to existing lock implementations with minimal changes and without sacrificing backward compatibility?

Key findings

  • BRAVO enables existing reader-writer locks to scale efficiently under high read concurrency by reducing cache coherence traffic through distributed reader signaling.
  • The use of thread identity hashing spreads reader updates across the visible readers table, minimizing contention and improving NUMA locality.
  • BRAVO maintains a compact lock representation with only two additional integer fields, avoiding the bloat of cohort-based designs.
  • The shared visible readers table allows all locks and threads in the address space to coordinate reader presence efficiently, enhancing scalability.
  • By diffusing reader updates across the table, BRAVO reduces the frequency of cache line invalidations and improves overall system throughput under read-heavy workloads.
  • The transformation is lightweight and compatible with existing lock implementations, enabling deployment with minimal engineering effort.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.