unstacked

Crates.iounstacked
lib.rsunstacked
version0.1.2
sourcesrc
created_at2025-05-10 18:23:23.782935+00
updated_at2025-05-13 07:27:50.925709+00
descriptionLock-free, no-std concurrent stack for Rust
homepage
repositoryhttps://github.com/cestef/unstacked
max_upload_size
id1668676
size30,419
cstef (cestef)

documentation

README

unstacked banner

Concurrent, lock-free, no-std stack implementation in Rust.

  • Uses atomic compare-and-exchange operations for thread safety
  • Implements tagged pointers to prevent the ABA problem
  • Each modification increments a tag counter to detect concurrent modifications
  • Safe for concurrent access from multiple threads

Example

use unstacked::Stack;
let stack: Stack<i32> = Stack::new();
stack.push(1);
assert_eq!(stack.pop(), Some(1));
assert_eq!(stack.pop(), None);

stack.push(2);
assert_eq!(stack.peek(), Some(2).as_ref());
assert!(!stack.is_empty())
Commit count: 0

cargo fmt