Search engine for discovering works of Art, research articles, and books related to Art and Culture
ShareThis
Javascript must be enabled to continue!

Safe-by-default Concurrency for Modern Programming Languages

View through CrossRef
Modern “safe” programming languages follow a design principle that we call safety by default and performance by choice . By default, these languages enforce important programming abstractions, such as memory and type safety, but they also provide mechanisms that allow expert programmers to explicitly trade some safety guarantees for increased performance. However, these same languages have adopted the inverse design principle in their support for multithreading. By default, multithreaded programs violate important abstractions, such as program order and atomic access to individual memory locations to admit compiler and hardware optimizations that would otherwise need to be restricted. Not only does this approach conflict with the design philosophy of safe languages, but very little is known about the practical performance cost of providing a stronger default semantics. In this article, we propose a safe-by-default and performance-by-choice multithreading semantics for safe languages, which we call volatile -by-default . Under this semantics, programs have sequential consistency (SC) by default, which is the natural “interleaving” semantics of threads. However, the volatile -by-default design also includes annotations that allow expert programmers to avoid the associated overheads in performance-critical code. We describe the design, implementation, optimization, and evaluation of the volatile -by-default semantics for two different safe languages: Java and Julia. First, we present V BD-HotSpot and V BDA-HotSpot, modifications of Oracle’s HotSpot JVM that enforce the volatile -by-default semantics on Intel x86-64 hardware and ARM-v8 hardware. Second, we present S C-Julia, a modification to the just-in-time compiler within the standard Julia implementation that provides best-effort enforcement of the volatile -by-default semantics on x86-64 hardware for the purpose of performance evaluation. We also detail two different implementation techniques: a baseline approach that simply reuses existing mechanisms in the compilers for handling atomic accesses, and a speculative approach that avoids the overhead of enforcing the volatile -by-default semantics until there is the possibility of an SC violation. Our results show that the cost of enforcing SC is significant but arguably still acceptable for some use cases today. Further, we demonstrate that compiler optimizations as well as programmer annotations can reduce the overhead considerably.
Title: Safe-by-default Concurrency for Modern Programming Languages
Description:
Modern “safe” programming languages follow a design principle that we call safety by default and performance by choice .
By default, these languages enforce important programming abstractions, such as memory and type safety, but they also provide mechanisms that allow expert programmers to explicitly trade some safety guarantees for increased performance.
However, these same languages have adopted the inverse design principle in their support for multithreading.
By default, multithreaded programs violate important abstractions, such as program order and atomic access to individual memory locations to admit compiler and hardware optimizations that would otherwise need to be restricted.
Not only does this approach conflict with the design philosophy of safe languages, but very little is known about the practical performance cost of providing a stronger default semantics.
In this article, we propose a safe-by-default and performance-by-choice multithreading semantics for safe languages, which we call volatile -by-default .
Under this semantics, programs have sequential consistency (SC) by default, which is the natural “interleaving” semantics of threads.
However, the volatile -by-default design also includes annotations that allow expert programmers to avoid the associated overheads in performance-critical code.
We describe the design, implementation, optimization, and evaluation of the volatile -by-default semantics for two different safe languages: Java and Julia.
First, we present V BD-HotSpot and V BDA-HotSpot, modifications of Oracle’s HotSpot JVM that enforce the volatile -by-default semantics on Intel x86-64 hardware and ARM-v8 hardware.
Second, we present S C-Julia, a modification to the just-in-time compiler within the standard Julia implementation that provides best-effort enforcement of the volatile -by-default semantics on x86-64 hardware for the purpose of performance evaluation.
We also detail two different implementation techniques: a baseline approach that simply reuses existing mechanisms in the compilers for handling atomic accesses, and a speculative approach that avoids the overhead of enforcing the volatile -by-default semantics until there is the possibility of an SC violation.
Our results show that the cost of enforcing SC is significant but arguably still acceptable for some use cases today.
Further, we demonstrate that compiler optimizations as well as programmer annotations can reduce the overhead considerably.

Related Results

DOMASCOS (DOMAin Specific COncurrency Skeletons)
DOMASCOS (DOMAin Specific COncurrency Skeletons)
Existing approaches to concurrent programming, albeit essential, are easily used incorrectly. Testing is difficult due to the inherent non-determinism introduced by concurrency, es...
Concurrent Scaling: Evaluating AWS Lambda Performance through Load Testing
Concurrent Scaling: Evaluating AWS Lambda Performance through Load Testing
Abstract In the dynamic environment of serverless computing, efficient concurrency management and reasonable utilization of load testing techniques closely correlate with p...
Analysis of Sukuk Cross-Default Clause: A Fiqh Perspective
Analysis of Sukuk Cross-Default Clause: A Fiqh Perspective
In recent time, there have been incessant Sukuk default cases which are posing a severe challenge to the growth of the nascent Islamic finance Industry. Institutions and principal ...
Programming Language as Eligible One: Legal Aspects
Programming Language as Eligible One: Legal Aspects
The article examines the situation with the introduction of programming languages as an eligible element and the possibilities of recognizing programming languages as acceptable an...
Housing loan default in Malaysia: an analytical insight and policy implications
Housing loan default in Malaysia: an analytical insight and policy implications
Purpose The purpose of this paper is to examine the drivers of default in the Malaysian housing market in the light of various policy interventions by the country’s central bank, a...
Not that Concurrent!
Not that Concurrent!
Concurrency is, in the literature, often used as a noun with a range of strengths: there is more or less concurrency; it is more or less limited; it may even be seen described as c...

Back to Top