Skip to content
Browse files

Extend documentation for `conc::sync::Treiber`.

  • Loading branch information...
ticki committed Jun 8, 2017
1 parent 0c33627 commit 6fdacfdc8908f37376039c32558e3a02cbf0c147
Showing with 11 additions and 0 deletions.
  1. +11 −0 conc/src/sync/
@@ -5,12 +5,23 @@ use std::{mem, ptr};
use {Atomic, Guard};

/// A Treiber stack.
/// Treiber stacks are one way to implement concurrent LIFO stack.
/// Treiber stacks builds on linked lists. They are lock-free and non-blocking. It can be compared
/// to transactional memory in that it repeats operations, if another thread changes it while.
/// The ABA problem is of course addressed through the API of this crate.
pub struct Treiber<T> {
/// The head node.
head: Atomic<Node<T>>,

/// A node in the stack.
struct Node<T> {
/// The data this node holds.
data: T,
/// The next node.
next: *const Node<T>,

0 comments on commit 6fdacfd

Please sign in to comment.
You can’t perform that action at this time.