一句话:提出资源感知会话类型,静态推导消息传递并发进程的最坏情况总工作量。
本文研究消息传递并发进程的静态资源分析:顺序代码的资源界技术难以处理交互进程。作者提出资源感知会话类型,将二元会话类型与基于类型的摊还资源分析结合在线性类型系统中。关键创新是消息与进程均携带 potential,可在通信中共享和摊还成本;资源契约以进程交互的函数形式描述界,无需静态数据结构和固有大小。该系统在 SILL 核心演算上形式化,并相对于跟踪消息数的多重集操作代价语义证明可靠性。实验通过经典摊还分析、会话类型例子及同一接口不同并发实现的比较性能分析,验证了有效性。
While there exist several successful techniques for supporting programmers in deriving static resource bounds for sequential code, analyzing the resource usage of message-passing concurrent processes poses additional challenges. To meet these challenges, this article presents an analysis for statically deriving worst-case bounds on the total work performed by message-passing processes. To decompose interacting processes into components that can be analyzed in isolation, the analysis is based on novel resource-aware session types, which describe protocols and resource contracts for inter-process communication. A key innovation is that both messages and processes carry potential to share and amortize cost while communicating. To symbolically express resource usage in a setting without static data structures and intrinsic sizes, resource contracts describe bounds that are functions of interactions between processes. Resource-aware session types combine standard binary session types and type-based amortized resource analysis in a linear type system. This type system is formulated for a core session-type calculus of the language SILL and proved sound with respect to a multiset-based operational cost semantics that tracks the total number of messages that are exchanged in a system. The effectiveness of the analysis is demonstrated by analyzing standard examples from amortized analysis and the literature on session types and by a comparative performance analysis of different concurrent programs implementing the same interface.