package lockfree

  1. Overview
  2. Docs

Module Lockfree.Treiber_stackSource

Classic multi-producer multi-consumer Treiber stack. Robust and flexible. Recommended starting point when needing LIFO structure.

Sourcetype 'a t

Type of Treiber stack holding items of type t.

Sourceval create : unit -> 'a t

create creates an empty Treiber stack.

Sourceval is_empty : 'a t -> bool

is_empty checks whether stack is empty.

Sourceval push : 'a t -> 'a -> unit

push inserts element into the stack.

Sourceval pop : 'a t -> 'a option

pop removes the youngest element from the stack (if any).