๐ค AI Summary
To address fairness and verifiability challenges in accessing shared objects (e.g., IPC channels) within cooperative scheduling runtimes, this paper proposes a spin-free, kernel-lock-free user-space mutual exclusion protocol. The protocol employs a lock-free FIFO queue to ensure ordered request enqueuing and leverages cooperative scheduling semantics to guarantee linearizability and strict FIFO fairness. It introduces a reusable fairness verification mechanism and applies formal modeling and verification using CSP and FDR. Notably, it presents the first claim/release protocol implemented in the ProcessJ runtime that eliminates both kernel locks and busy-waiting. Experimental evaluation demonstrates that the protocol significantly improves predictability and safety of concurrent programs. By providing a formally verified, fair synchronization primitive, it advances the design of coroutine- and lightweight-thread-based runtimes, enabling rigorous reasoning about fairness properties in cooperative execution environments.
๐ Abstract
We present the first spin-free, kernel-lock-free mutex that cooperates with user-mode schedulers and is formally proven FIFO-fair and linearizable using CSP/FDR. Our fairness oracle and stability-based proof method are reusable across coroutine runtime designs. We designed the claim/release protocol for a process-oriented language -- ProcessJ -- to manage the race for claiming shared inter-process communication channels. Internally, we use a lock-free queue to park waiting processes for gaining access to a shared object, such as exclusive access to a shared channel to read from or write to. The queue ensures control and fairness for processes wishing to access a shared resource, as the protocol handles claim requests in the order they are inserted into the queue. We produce CSP models of our protocol and a mutex specification, demonstrating with FDR that our protocol behaves as a locking mutex.