Deadlock-Free Asynchronous Message Reordering in Rust with Multiparty Session Types
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, sending and receiving messages in an arbitrary order to maximise computation-communication overlap (a popular optimisation in message-passing applications) opens up a Pandora’s box of 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 (k-MC), 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 k-MC and a binary session subtyping algorithm. We find they are exponentially slower than Rumpsteak’s.
Wed 6 AprDisplayed time zone: Eastern Time (US & Canada) change
10:20 - 11:20 | |||
10:20 15mTalk | Deadlock-Free Asynchronous Message Reordering in Rust with Multiparty Session Types Main Conference Zak Cutner Imperial College London, Nobuko Yoshida Imperial College London, Martin Vassor Imperial College London | ||
10:35 15mTalk | Detectable Recovery of Lock-Free Data Structures Main Conference Hagit Attiya Technion, Ohad Ben-Baruch Ben-Gurion University of the Negev, Panagiota Fatourou FORTH ICS and University of Crete, Greece, Danny Hendler BGU, Eleftherios Kosmas Department of Computer Science, University of Crete, Greece | ||
10:50 15mTalk | Lock-Free Locks Revisited Main Conference Naama Ben-David VMware, Guy E. Blelloch Carnegie Mellon University, USA, Yuanhao Wei Carnegie Mellon University, USA | ||
11:05 15mTalk | Asymmetry-aware Scalable Locking Main Conference Nian Liu Shanghai Jiao Tong University, Jinyu Gu Shanghai Jiao Tong University, Dahai Tang Hunan university, Kenli Li National Supercomputing Center in Changsha, Hunan University, Binyu Zang Shanghai Jiao Tong University, Haibo Chen Shanghai Jiao Tong University |