Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQS #41

Open
kayceesrk opened this issue Dec 12, 2022 · 2 comments
Open

CQS #41

kayceesrk opened this issue Dec 12, 2022 · 2 comments
Labels
help wanted new data structure Proposal for new data and synchronization structures

Comments

@kayceesrk
Copy link
Collaborator

From the abstract

We introduce a new framework called the CancellableQueueSynchronizer (CQS), which enables efficient fair and abortable implementations of fundamental synchronization primitives such as mutexes, semaphores, barriers, count-down-latches, and blocking pools. Our first contribution is algorithmic, as implementing both fairness and abortability efficiently at this level of generality is non-trivial. Importantly, all our algorithms come with formal proofs in the Iris framework for Coq. These proofs are modular, so it is easy to prove correctness for new primitives implemented on top of CQS. To validate practical impact, we integrated CQS into the Kotlin Coroutines library. Compared against Java's AbstractQueuedSynchronizer, the only practical abstraction to provide similar semantics, CQS shows significant improvements across all benchmarks, of up to two orders of magnitude. In sum, CQS is the first framework to combine expressiveness with formal guarantees and strong practical performance, and should be extensible to other languages and other families of synchronization primitives.

I would think that we can make this work with effects.

[1] https://arxiv.org/abs/2111.12682
[2] https://nikitakoval.org/talks/#hydra-2020-sqs

@kayceesrk kayceesrk added help wanted new data structure Proposal for new data and synchronization structures labels Dec 12, 2022
@bartoszmodelski
Copy link
Contributor

cc @talex5 who mentioned this

@talex5
Copy link

talex5 commented Dec 12, 2022

Yeah, it's tracked in ocaml-multicore/eio#382

I have a prototype mostly working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted new data structure Proposal for new data and synchronization structures
Projects
None yet
Development

No branches or pull requests

3 participants