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

SCQ: Add combining arena #2

Closed
ben-manes opened this issue Dec 17, 2014 · 0 comments
Closed

SCQ: Add combining arena #2

ben-manes opened this issue Dec 17, 2014 · 0 comments

Comments

@ben-manes
Copy link
Owner

Decide on which approaches and implement. The arena should be lazily initialized and grow on contention to reduce the footprint in uncontested usages.

Optimistic w/ combiner mode
Once a producer can combine, it can no longer offer back to the arena on a CAS failure to the queue. The advantage is that no garbage is created as the arena holds only unlinked nodes.

Optimistic with dynamic mode
A producer can pivot between a combiner or transferrer on each failed CAS loop to the queue. A batch insert requires knowing the both the first and last nodes forming a linked list to be appended to the queue. The arena slot must hold both references.

Linearizable
In this mode, a producer that transferred its node must wait it to be added before completing the call. This requires a wrapper with a flag that the waiter spins on and, upon insertion, the combiner sets.

@ben-manes ben-manes removed the ready label Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant