paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Disentanglement with Futures, State, and Interaction

Future、状态与交互中的解缠
POPL 8(POPL)2024匹配度 2/10 · 论文研究 future 并行下的解缠(disentanglement)形式语义与无死锁性,属于并发/内存模型理论,与用户核心关注的 LLM/Agent 与静态分析、形式化验证交叉,以及浮点或贝叶斯程序分析均无直接关系。仅在形式化方法层面有非常微弱的关联。引用 0 inbox
Jatin Arora, Stefan K. Muller, Umut A. Acar
crossref: 2026-09-10

AI 速览

一句话:将解缠从 fork/join 推广到 future 并行,并证明其在状态、交互下的保持及无死锁性。

现有解缠(disentanglement)研究仅针对 fork/join 并行模型,无法直接适用于更强大的 future 并行,因为 future 使并行计算成为一等值,可被传递和存储,并与可变状态交互,产生复杂依赖甚至死锁。本文研究解缠能否推广到 future。作者考虑一个带有 future、输入/输出和可变引用(状态)的函数式语言,首先为 future 形式化解缠,并证明纯函数式程序是解缠的;随后从三个方向推广:带状态程序若数据竞争自由则解缠;竞争自由是充分但非必要条件,某些使用原子读-改-写和非确定性组合子的程序也可解缠;最后证明用 future 编写的解缠任务并行程序无死锁。这些结果表明解缠可推广到 future 并行,其收益不限于 fork/join。

问题
先前解缠工作只适用于 fork/join 并行,而 future 并行允许一等并行计算、复杂依赖、可变状态和死锁,因此解缠能否推广到 future 尚不明确。
方法
作者在一个含 future、I/O 和可变引用的函数式语言中形式化解缠概念,并通过语义论证与证明依次分析纯函数程序、无竞争状态程序、部分非确定性程序以及死锁自由性。
评估
评估以形式化定义和证明为主:证明纯程序解缠、无竞争状态程序解缠、部分非确定性程序也可解缠,并证明解缠的 future 任务并行程序无死锁。
原文摘要(Abstract)

Recent work has proposed a memory property for parallel programs, called disentanglement, and showed that it is pervasive in a variety of programs, written in different languages, ranging from C/C++ to Parallel ML, and showed that it can be exploited to improve the performance of parallel functional programs. All existing work on disentanglement, however, considers the “fork/join” model for parallelism and does not apply to “futures”, the more powerful approach to parallelism. This is not surprising: fork/join parallel programs exhibit a reasonably strict dependency structure (e.g., series-parallel DAGs), which disentanglement exploits. In contrast, with futures, parallel computations become first-class values of the language, and thus can be created, and passed between functions calls or stored in memory, just like other ordinary values, resulting in complex dependency structures, especially in the presence of mutable state. For example, parallel programs with futures can have deadlocks, which is impossible with fork-join parallelism. In this paper, we are interested in the theoretical question of whether disentanglement may be extended beyond fork/join parallelism, and specifically to futures. We consider a functional language with futures, Input/Output (I/O), and mutable state (references) and show that a broad range of programs written in this language are disentangled. We start by formalizing disentanglement for futures and proving that purely functional programs written in this language are disentangled. We then generalize this result in three directions. First, we consider state (effects) and prove that stateful programs are disentangled if they are race free. Second, we show that race freedom is sufficient but not a necessary condition and non-deterministic programs, e.g. those that use atomic read-modify-operations and some non-deterministic combinators, may also be disentangled. Third, we prove that disentangled task-parallel programs written with futures are free of deadlocks, which arise due to interactions between state and the rich dependencies that can be expressed with futures. Taken together, these results show that disentanglement generalizes to parallel programs with futures and, thus, the benefits of disentanglement may go well beyond fork-join parallelism.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2633,
  title = {Disentanglement with Futures, State, and Interaction},
  author = {Jatin Arora and Stefan K. Muller and Umut A. Acar},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632895}
}