Skip to main content

Crate concurrent_intrusive_collections

Crate concurrent_intrusive_collections 

Source
Expand description

Intrusive concurrent collections backed by Crossbeam’s epoch collector.

Nodes implement SinglyLinked and, optionally, DoublyLinked. Links point directly to complete nodes, so there are no adapters or link-to-node conversions. The default std feature enables the sharded stack, sharded ConcurrentShardedQueue. Disabling it leaves the link traits and the alloc-enabled epoch API.

§Choosing a collection

  • ConcurrentShardedQueue: per-shard FIFO with local enqueue and XOR probing.
  • ConcurrentShardedStack: per-shard LIFO with local push and XOR probing.

Collections take ownership through Box<T> and return results from shared-borrow callbacks. They do not return removed nodes for immediate reuse. Queue shards retain their last consumed node as a dummy until the next pop or destruction. See each collection for ordering and reclamation semantics.

Rust 1.85 or newer and pointer-width atomic operations are required.

Re-exports§

pub use crossbeam_epoch as epoch;

Structs§

AtomicLink
An atomic forward/backward link stored privately in an intrusive node.
ConcurrentShardedQueue
An intrusive MPMC queue distributed across independent FIFO shards.
ConcurrentShardedStack
An intrusive Treiber stack distributed across cache-padded shards.

Enums§

PopError
The result of an operation that did not find a node.
PushError
A rejected push, retaining ownership of the unpublished node.

Traits§

DoublyLinked
A node that also contains an atomic backward link.
SinglyLinked
A node containing an atomic forward link to another complete node.