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

Make core capq operations wait-free. #6

Merged
merged 5 commits into from
Jun 2, 2022
Merged

Make core capq operations wait-free. #6

merged 5 commits into from
Jun 2, 2022

Conversation

viega
Copy link
Owner

@viega viega commented Jun 2, 2022

I've changed the overall capq implementation, refactoring it to ensure that calls to top() are wait-free, so that one can use this abstraction to implement other wait-free algorithms.

This actually simplified the algorithm and seems to have improved performance considerably as well.

Note that it's still possible to use this abstraction in a way that destroys the progress guarantees. For example, I still provide a capq_dequeue operation built on top of top() plus compare-and-pop(), which is only lock-free (the operation mainly exists so that we can use the same code for testing capq as we do for other queues).

viega added 5 commits June 1, 2022 17:57
… capq_cap and migrate still need to be done.
…capq_dequeue,which is currently implemented in a lock free manner on top of capq_top() and capq_pop().
…lue was a valid top() at some point after its operation started. Always being willing to return a valid, but potentially stale value simplifies the hoops we need to jump through for wait freedom, as we can bound our search to just those items that potentially were enqueued when we read the enqueue epoch, unless updates loop around the store. That second case still leads to retries, but we bound the number of times we allow that to happen, by forcing store expansion if that becomes a problem.
@viega viega merged commit 8885a6a into main Jun 2, 2022
@viega viega deleted the wfcapq branch June 2, 2022 18:27
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