Basic Lock Algorithms in Lightweight Thread Environments
Taras Skazhenik, Nikolai Korobenikov, Andrei Churbanov, Anton Malakhov, Vitaly Aksenov

TL;DR
This paper adapts basic lock algorithms for lightweight thread environments, addressing deadlock issues and proposing a new cohort lock that balances performance across different lightweight thread libraries.
Contribution
It introduces modifications to TTAS and MCS locks for lightweight threads and proposes a new cohort lock to improve performance and compatibility.
Findings
Modified TTAS and MCS locks are effective with lightweight threads.
Yielding and sleeping mechanisms are crucial for lock performance.
Cohort lock balances performance across different thread libraries.
Abstract
Traditionally, multithreaded data structures have been designed for access by the threads of Operating Systems (OS). However, implementations for access by programmable alternatives known as lightweight threads (also referred to as asynchronous calls or coroutines) have not been thoroughly studied. The main advantage of lightweight threads is their significantly lower overhead during launch and context switching. However, this comes at a cost: to achieve proper parallelism, context switches must be manually invoked in the code; without these switches, new lightweight threads will never be executed. In this paper, we focus on the simplest multithreaded data structure: a mutex (also known as a lock). We demonstrate that original implementations for OS threads cannot be used effectively in this new context due to the potential for deadlocks. Furthermore, correctness is not the only…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDistributed systems and fault tolerance · Real-Time Systems Scheduling · Parallel Computing and Optimization Techniques
