package moonpool

  1. Overview
  2. Docs
Pools of threads supported by a pool of domains

Install

dune-project
 Dependency

Authors

Maintainers

Sources

moonpool-0.11.tbz
sha256=0f3d42753c2636a6a55427af89d2574b08a29c32100f2002ae3e47f6e4d23ff1
sha512=7fa651570493ddd7c594eb46b76782610da6a6823e5178c2b20ceafe2f159649caedaac01e975428605de865d3dff9008a798090cec77c909477a86c04532709

doc/moonpool.private/Moonpool_private/Ws_deque_/index.html

Module Moonpool_private.Ws_deque_Source

Work-stealing deque.

Adapted from "Dynamic circular work stealing deque", Chase & Lev.

However note that this one is not dynamic in the sense that there is no resizing. Instead we return false when push fails, which keeps the implementation fairly lightweight.

Sourcetype 'a t

Deque containing values of type 'a

Sourceval create : dummy:'a -> unit -> 'a t

Create a new deque.

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

Push value at the bottom of deque. returns true if it succeeds. This must be called only by the owner thread.

Sourceval pop : 'a t -> 'a option

Pop value from the bottom of deque. This must be called only by the owner thread.

Sourceexception Empty
Sourceval pop_exn : 'a t -> 'a
Sourceval steal : 'a t -> 'a option

Try to steal from the top of deque. This is thread-safe.

Sourceval size : _ t -> int