Responsive Parallelism with Futures and State

04/06/2020
by   Stefan K. Muller, et al.
0

Motivated by the increasing shift to multicore computers, recent work has developed language support for responsive parallel applications that mix compute-intensive tasks with latency-sensitive, usually interactive, tasks. These developments include calculi that allow assigning priorities to threads, type systems that can rule out priority inversions, and accompanying cost models for predicting responsiveness. These advances share one important limitation: all of this work assumes purely functional programming. This is a significant restriction, because many realistic interactive applications, from games to robots to web servers, use mutable state, e.g., for communication between threads. In this paper, we lift the restriction concerning the use of state. We present λ_i^4, a calculus with implicit parallelism in the form of prioritized futures and mutable state in the form of references. Because both futures and references are first-class values, λ_i^4 programs can exhibit complex dependencies, including interaction between threads and with the external world (users, network, etc). To reason about the responsiveness of λ_i^4 programs, we extend traditional graph-based cost models for parallelism to account for dependencies created via mutable state, and we present a type system to outlaw priority inversions that can lead to unbounded blocking. We show that these techniques are practical by implementing them in C++ and present an empirical evaluation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/10/2018

Competitive Parallelism: Getting Your Priorities Right

Multi-threaded programs have traditionally fallen into one of two domain...
research
07/01/2021

Efficient Tree-Traversals: Reconciling Parallelism and Dense Data Representations

Recent work showed that compiling functional programs to use dense, seri...
research
04/07/2023

Responsive Parallelism with Synchronization

Many concurrent programs assign priorities to threads to improve respons...
research
10/03/2019

Types for Parallel Complexity in the Pi-calculus

Type systems as a way to control or analyze programs have been largely s...
research
12/09/2022

Parallelism detection using graph labelling

Usage of multiprocessor and multicore computers implies parallel program...
research
06/19/2019

Reduced I/O Latency with Futures

Task parallelism research has traditionally focused on optimizing comput...
research
07/09/2021

A cost-aware logical framework

We present calf, a cost-aware logical framework for studying quantitativ...

Please sign up or login with your details

Forgot password? Click here to reset