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

Add a "lazy" queue #145

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add a "lazy" queue #145

wants to merge 1 commit into from

Conversation

polytypic
Copy link
Contributor

@polytypic polytypic commented Jul 9, 2024

This essentially uses a "lazy" semi-immutable queue implemented using a mutable spine that is updated incrementally such that every operation on the queue is O(1).

The lazy queue is then wrapped as a single atomic.

This results in a relatively space efficient concurrent queue. Performance also seems relatively good with the obvious caveat that as only a single atomic is used, that atomic is a contention point, which somewhat limits scalability compared to queues that have separate mutable head and tail atomics.

@polytypic polytypic force-pushed the add-lazy-queue branch 9 times, most recently from b83355a to 5fe2462 Compare July 9, 2024 12:08
This essentially uses a "lazy" semi-immutable queue implemented using a mutable
spine that is updated incrementally such that every operation on the queue is
O(1).

The lazy queue is then wrapped as a single atomic.

This results in a relatively space efficient concurrent queue.  Performance also
seems relatively good with the obvious caveat that as only a single atomic is
used, that atomic is a contention point, which somewhat limits scalability
compared to queues that have separate mutable head and tail atomics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant