Rust is a modern systems language focused on performance and reliability. Complementing Rust's promise to provide "fearless concurrency", developers frequently exploit asynchronous message passing. Unfortunately, arbitrarily ordering sending and receiving messages to maximise computation-communication overlap (a popular optimisation to message-passing applications) opens up a Pandora's box of further subtle concurrency bugs. To guarantee deadlock-freedom by construction, we present Rumpsteak: a new Rust framework based on multiparty session types. Previous session type implementations in Rust are either built upon synchronous and blocking communication and/or limited to two-party interactions. Crucially, none support the arbitrary ordering of messages for efficiency. Rumpsteak instead targets asynchronous async/await code. Its unique ability is allowing developers to arbitrarily order send/receive messages while preserving deadlock-freedom. For this, Rumpsteak incorporates two recent advanced session type theories: (1) k-multiparty compatibility (kmc), which globally verifies the safety of a set of participants, and (2) asynchronous multiparty session subtyping, which locally verifies optimisations in the context of a single participant. Specifically, we propose a novel algorithm for asynchronous subtyping that is both sound and decidable. We first evaluate the performance and expressiveness of Rumpsteak against three previous Rust implementations. We discover that Rumpsteak is around 1.7--8.6x more efficient and can safely express many more examples by virtue of offering arbitrary message ordering. Secondly, we analyse the complexity of our new algorithm and benchmark it against kmc and a binary session subtyping algorithm. We find they are exponentially slower than Rumpsteak's.
翻译:鲁斯特(Rust)承诺提供“ 无畏的骗局货币 ”, 开发者经常利用无节制的信息传递。 不幸的是, 武断地命令发送和接收信息以最大限度地实现计算通信重叠( 给信息传递应用程序带来最优化), 开启了潘多拉( Pandora) 的一箱更微妙的货币错误。 为了保证无僵局, 我们用建筑来保证无僵局。 拉姆普斯泰克( Rumpssteak) : 基于多党会议类型的新 Rust 框架 。 鲁斯特( Rust) 的前几届执行要么建立在同步和阻塞通/ 限制两党互动的基础上。 奇怪的是, 没有人支持武断地命令信息的效率。 朗普斯泰克( Pandora) 开启了更微妙的通信重叠( ) 。 伦普斯泰克( Rampsteak) 包含了两个最近的高级届会类型理论:(1) k- multical 兼容性( kent), 也就是全球验证参与者的一组安全性, 以及( ) 和两党内部的快速的货币交易, 提供了我们前几级版本版本的运行的运行的版本。