paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Higher-Order Leak and Deadlock Free Locks

高阶锁的无泄漏与无死锁
POPL 7(POPL)2023匹配度 2/10 · 该论文属于并发程序语言理论(高阶锁的类型系统、无死锁/无泄漏证明与 Coq 机器化验证),与用户关注的四个方向均无交集:既不涉及静态分析在 ML/Agent 程序中的应用,也不涉及 LLM/Agent 辅助形式化验证,更与浮点程序分析或贝叶斯程序分析无关。仅在“形式化方法与类型系统”这一宽泛的 PL 背景上有所重叠,但缺乏 LLM 交叉与工程落地视角,因此匹配度较低。引用 5 inbox
Jules Jacobs, Stephanie Balzer
crossref: 2026-09-10

AI 速览

一句话:提出基于共享拓扑的高阶锁理论,证明良类型程序无死锁且无内存泄漏,并在 Coq 中机器化验证。

并发程序共享数据时,锁虽可防止数据竞争,却可能引入死锁与内存泄漏;当锁本身是一等公民、可被高阶共享时,这一问题尤为棘手。本文在共享内存并发场景下建立高阶锁的无死锁与无泄漏理论。核心概念是“共享拓扑”,它刻画程序中谁在何时有权访问共享数据。作者首先在一个含高阶锁与消息传递并发的 λ-演算中,为无环共享拓扑构造类型系统;随后扩展演算以支持具有动态锁顺序的循环依赖,并以动态版 Dijkstra 哲学家就餐问题加以说明。作者证明所得演算中良类型程序既无死锁也无内存泄漏,所有证明均在 Coq 证明助手中机器化验证。该工作为 Rust 式的所有权与锁类型系统提供了更精细的共享安全基础。

问题
并发共享内存程序中,锁能防止数据竞争,却会带来死锁与内存泄漏风险;当锁可作为一等值被高阶共享时,现有理论缺乏对无死锁、无泄漏的保证。
方法
提出基于“共享拓扑”(记录谁在何时可访问共享数据)的类型理论,在带高阶锁与消息传递并发的 λ-演算中形式化,先处理无环拓扑,再扩展以支持动态锁顺序下的循环依赖。
评估
通过类型安全定理证明良类型程序无死锁且无内存泄漏,并给出动态版哲学家就餐问题等实例;全部证明在 Coq 证明助手中机器化验证。
原文摘要(Abstract)

Reasoning about concurrent programs is challenging, especially if data is shared among threads. Program correctness can be violated by the presence of data races—whose prevention has been a topic of concern both in research and in practice. The Rust programming language is a prime example, putting the slogan fearless concurrency in practice by not only employing an ownership-based type system for memory management, but also using its type system to enforce mutual exclusion on shared data. Locking, unfortunately, not only comes at the price of deadlocks but shared access to data may also cause memory leaks . This paper develops a theory of deadlock and leak freedom for higher-order locks in a shared memory concurrent setting. Higher-order locks allow sharing not only of basic values but also of other locks and channels, and are themselves first-class citizens. The theory is based on the notion of a sharing topology , administrating who is permitted to access shared data at what point in the program. The paper first develops higher-order locks for acyclic sharing topologies, instantiated in a λ-calculus with higher-order locks and message-passing concurrency. The paper then extends the calculus to support circular dependencies with dynamic lock orders, which we illustrate with a dynamic version of Dijkstra’s dining philosophers problem. Well-typed programs in the resulting calculi are shown to be free of deadlocks and memory leaks, with proofs mechanized in the Coq proof assistant.

链接与引用

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

BibTeX
@article{paperbot2110,
  title = {Higher-Order Leak and Deadlock Free Locks},
  author = {Jules Jacobs and Stephanie Balzer},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571229}
}