Skip to main content
Kent Academic Repository

SC-Haskell: Sequential Consistency in Languages That Minimize Mutable Shared Heap

Vollmer, Michael, Scott, Ryan G., Musuvathi, Madanlal, Newton, Ryan R. (2017) SC-Haskell: Sequential Consistency in Languages That Minimize Mutable Shared Heap. ACM SIGPLAN Notices, 52 (8). pp. 283-298. ISSN 0362-1340. (doi:10.1145/3155284.3018746) (KAR id:98981)

Abstract

A core, but often neglected, aspect of a programming language design is its memory (consistency) model. Sequential consistency~(SC) is the most intuitive memory model for programmers as it guarantees sequential composition of instructions and provides a simple abstraction of shared memory as a single global store with atomic read and writes. Unfortunately, SC is widely considered to be impractical due to its associated performance overheads. Perhaps contrary to popular opinion, this paper demonstrates that SC is achievable with acceptable performance overheads for mainstream languages that minimize mutable shared heap. In particular, we modify the Glasgow Haskell Compiler to insert fences on all writes to shared mutable memory accessed in nonfunctional parts of the program. For a benchmark suite containing 1,279 programs, SC adds a geomean overhead of less than 0.4 on an x86 machine. The efficiency of SC arises primarily due to the isolation provided by the Haskell type system between purely functional and thread-local imperative computations on the one hand, and imperative computations on the global heap on the other. We show how to use new programming idioms to further reduce the SC overhead; these create a virtuous cycle of less overhead and even stronger semantic guarantees (static data-race freedom).

Item Type: Article
DOI/Identification number: 10.1145/3155284.3018746
Uncontrolled keywords: functional programming, memory models, sequential consistency
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Funders: National Science Foundation (https://ror.org/021nxhr62)
Depositing User: Michael Vollmer
Date Deposited: 07 Dec 2022 21:36 UTC
Last Modified: 05 Nov 2024 13:04 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/98981 (The current URI for this page, for reference purposes)

University of Kent Author Information

  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.