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

Priority queue #31

Open
bartoszmodelski opened this issue Nov 2, 2022 · 3 comments
Open

Priority queue #31

bartoszmodelski opened this issue Nov 2, 2022 · 3 comments
Labels
help wanted new data structure Proposal for new data and synchronization structures

Comments

@bartoszmodelski
Copy link
Contributor

bartoszmodelski commented Nov 2, 2022

Priority queues are ubiquitous. I think it would make sense to have one here as it would be useful for scheduling, be it at an actual scheduler level or much higher, e.g. in event loop, which should prioritise user input over some compute.

There is a lot of literature. Probably a good place to start is the chapter on priority queues in The Art of Multiprocessor Programming.

@bartoszmodelski bartoszmodelski added the new data structure Proposal for new data and synchronization structures label Dec 12, 2022
@jake-87
Copy link

jake-87 commented May 16, 2024

https://engineering.lehigh.edu/sites/engineering.lehigh.edu/files/_DEPARTMENTS/cse/research/tech-reports/2011/lu-cse-11-004.pdf
"A Lock-Free, Array-Based Priority Queue"

The above seems appealing - if its benchmarks are accurate, it seems to be more efficient then the lock-free skiplist-based prioqueue described in "The Art Of Multiprocessor Programming".

@lyrm
Copy link
Collaborator

lyrm commented Dec 6, 2024

This implementation appears quite interesting but relies on double compare-and-set operations, which are not available in OCaml. While it would be possible to use kcas, in that case, the implementation would be more appropriately placed in kcas_data rather than here.

@lyrm
Copy link
Collaborator

lyrm commented Dec 6, 2024

Work is currently in progress to implement a priority queue based on the skip-list implementation available in Saturn and the algorithm described in The Art Of Multiprocessor programming.

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