论文标题

响应敏感的并行性与未来和国家

Responsive Parallelism with Futures and State

论文作者

Muller, Stefan K., Singer, Kyle, Goldstein, Noah, Acar, Umut A., Agrawal, Kunal, Lee, I-Ting Angelina

论文摘要

由于越来越多的计算机的转变,最近的工作为响应式并行应用提供了语言支持,这些应用程序将计算密集型任务与潜伏敏感的(通常是交互式)任务相结合。这些发展包括允许将优先级分配给线程的计算,类型可以排除优先级倒置的系统以及用于预测响应能力的随附成本模型。这些进步具有一个重要的局限性:所有这项工作都纯粹是功能性编程。这是一个重大限制,因为从游戏到机器人再到网络服务器的许多现实交互应用程序都使用可变状态,例如线程之间的通信。 在本文中,我们取消了有关使用状态的限制。我们提出$λ_i^4 $,一种具有隐式并行性的微积分,以优先的期货和可变状态的形式以参考的形式。由于期货和参考都是头等价值,因此$λ_i^4 $程序可以表现出复杂的依赖性,包括线程之间的互动以及与外部世界(用户,网络等)之间的交互。为了理解$λ_i^4 $程序的响应性,我们扩展了传统的基于图的成本模型,以使并行性考虑通过可变状态创建的依赖关系,并且我们提出了一种类型的系统,以禁止优先倒置,从而导致无界阻塞。我们表明,通过在C ++中实施这些技术并提出经验评估是实用的。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源