github ↗
docs menu

Module Rig.Point

Points on timelines.

A point is an immediate value, so storing one in an array or a record allocates nothing.

#type device := t
#type t

The type for points.

#val device : t -> device option

device p is Some d, p's device d, until d has stopped and a later device took its slot (Opening and closing), and None from then on.

#val value : t -> int

value p is p's value, above the value its device's timeline started after (submitted).

#val wait : t -> unit

wait p returns once p's device has reached p's value. It commits the device's work up to that value, then blocks however long that work runs, unless the device has a hang bound (Hangs). While it blocks it releases the domain lock (Domains). It returns at once for a point its device reached before a loss, whatever device its slot holds now.

Raises Lost if the device was lost before it reached p's value, or is lost during the wait before it does.

#val reached : t -> bool

reached p is true iff p's device has reached p's value, as wait would find it, also once a later device took p's slot. Otherwise it commits the device's work as wait does, so a loop on it ends once that work runs. The commit waits for no work. It waits up to 200 ms for another submit or commit on the device, and blocks while a driver that declares may_block commits.

Raises Lost if the device was lost before it reached p's value.

#val pp : Stdlib.Format.formatter -> t -> unit

pp formats a point as NAME:v, or ended:v once device is None.