Light-weight Locks

09/12/2011
by   Nitin Garg, et al.
0

In this paper, we propose a new approach to building synchronization primitives, dubbed "lwlocks" (short for light-weight locks). The primitives are optimized for small memory footprint while maintaining efficient performance in low contention scenarios. A read-write lwlock occupies 4 bytes, a mutex occupies 4 bytes (2 if deadlock detection is not required), and a condition variable occupies 4 bytes. The corresponding primitives of the popular pthread library occupy 56 bytes, 40 bytes and 48 bytes respectively on the x86-64 platform. The API for lwlocks is similar to that of the pthread library but covering only the most common use cases. Lwlocks allow explicit control of queuing and scheduling decisions in contention situations and support "asynchronous" or "deferred blocking" acquisition of locks. Asynchronous locking helps in working around the constraints of lock-ordering which otherwise limits concurrency. The small footprint of lwlocks enables the construction of data structures with very fine-grained locking, which in turn is crucial for lowering contention and supporting highly concurrent access to a data structure. Currently, the Data Domain File System uses lwlocks for its in-memory inode cache as well as in a generic doubly-linked concurrent list which forms the building block for more sophisticated structures.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/20/2017

Building Efficient Concurrent Graph Object through Composition of List-based Set

In this paper, we propose a generic concurrent directed graph (for share...
research
03/27/2018

Safe Non-blocking Synchronization in Ada 202x

The mutual-exclusion property of locks stands in the way to scalability ...
research
02/04/2022

Direct Telemetry Access

The emergence of programmable switches allows operators to collect a vas...
research
04/04/2018

Maintenance of Strongly Connected Component in Shared-memory Graph

In this paper, we propose a generic concurrent directed graph (for share...
research
10/20/2017

Parallel Combining: Making Use of Free Cycles

There are two intertwined factors that affect performance of concurrent ...
research
11/22/2021

A Formally-Verified Framework for Fair Synchronization in Kotlin Coroutines

Writing concurrent code that is both correct and efficient is notoriousl...
research
08/06/2018

The Internals of the Data Calculator

Data structures are critical in any data-driven scenario, but they are n...

Please sign up or login with your details

Forgot password? Click here to reset