arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.19541cs.PL
收藏

使用定时多方会话协议的无畏异步通信

Fearless Asynchronous Communications with Timed Multiparty Session Protocols

Ping Hou, Nicolas Lagaillardie, Nobuko Yoshida

AI总结:

本文提出首个基于多方会话类型的仿射性、时间约束、超时与时间故障处理形式化集成理论,静态保证异步定时通信的无死锁与无畏安全,并引入 Rust 工具链实现,验证其开销可忽略且适用于现实场景。

摘要:

使用仿射性和异常处理机制的会话类型已被开发出来,以确保并发和分布式编程语言中实现的协议的通信安全。然而,当前的仿射会话类型不足以规范现实世界的异步协议,因为它们通常受到时间约束的限制,这些约束启用超时异常以防止在等待有效消息时无限期阻塞。本文提出了基于多方会话类型的仿射性、时间约束、超时和时间故障处理的首次形式化集成,以支持异步分布式系统的可靠性。借助这一理论,我们静态地保证异步定时通信是无死锁的、通信安全的,并且是无畏的——永远不会被超时错误或突然终止所阻碍。为了实现我们的理论,我们引入了一个 Rust 工具链,旨在促进安全仿射定时协议的实现。我们的工具链利用泛型类型和时间库来处理定时通信,并与用于仿射性的可选类型集成。我们通过扩展文献中的各种示例以纳入时间和超时来评估我们的方法,证明与无时间限制的实现相比,我们的解决方案产生的开销可以忽略不计。我们还通过实现各种现实用例展示了我们方法的构造正确性,包括来自物联网远程领域的远程数据协议,以及来自实时系统的协议,如 Android 运动传感器和智能手表。

英文摘要:

Session types using affinity and exception handling mechanisms have been developed to ensure the communication safety of protocols implemented in concurrent and distributed programming languages. Nevertheless, current affine session types are inadequate for specifying real-world asynchronous protocols, as they are usually imposed by time constraints which enable timeout exceptions to prevent indefinite blocking while awaiting valid messages. This paper proposes the first formal integration of affinity, time constraints, timeouts, and time-failure handling based on multiparty session types for supporting reliability in asynchronous distributed systems. With this theory, we statically guarantee that asynchronous timed communication is deadlock-free, communication safe, while being fearless -- never hindered by timeout errors or abrupt terminations. To implement our theory, we introduce a Rust toolchain designed to facilitate the implementation of safe affine timed protocols. Our toolchain leverages generic types and the time library to handle timed communications, integrated with optional types for affinity. We evaluate our approach by extending diverse examples from the literature to incorporate time and timeouts, demonstrating that our solution incurs negligible overhead compared with an untimed implementation. We also showcase the correctness by construction of our approach by implementing various real-world use cases, including a remote data protocol from the Internet of Remote Things domain, as well as protocols from real-time systems like Android motion sensors and smartwatches.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑