Library
Module
Module type
Parameter
Class
Class type
val create : unit -> 'a t
create ()
returns a new empty work-stealing queue.
val push : 'a t -> 'a -> unit
push t v
adds v
to the front of the queue q
. It should only be invoked by the domain which owns the queue q
.
val pop : 'a t -> 'a
pop q
removes and returns the first element in queue q
.It should only be invoked by the domain which owns the queue q
.
val pop_opt : 'a t -> 'a option
pop_opt q
removes and returns the first element in queue q
, or returns None
if the queue is empty.
val steal : 'a t -> 'a
steal q
removes and returns the last element from queue q
. It should only be invoked by domain which doesn't own the queue q
.
val steal_opt : 'a t -> 'a option
steal_opt q
removes and returns the last element from queue q
, or returns None
if the queue is empty. It should only be invoked by domain which doesn't own the queue q
.