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

feat(cordyceps): add Stack and TransferStack #434

Merged
merged 14 commits into from
May 10, 2023
Merged

Conversation

hawkw
Copy link
Owner

@hawkw hawkw commented May 10, 2023

This branch adds an implementation of a singly-linked mutable FIFO
Stackand a singly-linked lock-free FIFO TransferStack in
cordyceps::stack.

A Stack is just your traditional FIFO stack structure.
TransferStack is a bit more interesting --- it's a simplification of
the traditional lock-free Treiber stack wher all elements are popped
into a new mutable Stack in a single atomic operation. This avoids the
ABA problem issues common with naive Treiber stack implementations. It's
intended primarily for use in a mimalloc-style sharded per-core memory
allocator.

Closes #137

@hawkw hawkw enabled auto-merge (squash) May 10, 2023 21:16
@hawkw hawkw self-assigned this May 10, 2023
@hawkw hawkw added kind/enhancement New feature or request crate/cordyceps Related to the `cordyceps` crate labels May 10, 2023
@hawkw hawkw merged commit 507b993 into main May 10, 2023
18 checks passed
@hawkw hawkw deleted the eliza/transfer-stack branch May 10, 2023 21:36
hawkw added a commit that referenced this pull request May 12, 2023
This branch adds an implementation of a singly-linked mutable FIFO
`Stack`and a singly-linked lock-free FIFO `TransferStack` in
`cordyceps::stack`.

A `Stack` is just your traditional FIFO stack structure.
`TransferStack` is a bit more interesting --- it's a simplification of
the traditional lock-free Treiber stack wher all elements are popped
into a new mutable `Stack` in a single atomic operation. This avoids the
ABA problem issues common with naive Treiber stack implementations. It's
intended primarily for use in a `mimalloc`-style sharded per-core memory
allocator.

Closes #137

Signed-off-by: Eliza Weisman <eliza@elizaswebsite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/cordyceps Related to the `cordyceps` crate kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cordyceps: intrusive transfer stack
1 participant