Shared queues
Queues where the elements have type 'e
and the header has
type 'h
The marshallble descriptor of queues
Raised when the queue is empty and the operation cannot be done
pop_p q f
: Takes the first element x
from the queue, removes it
there, and calls f x
. During the execution of f
the value x
is pinned and cannot be garbage-collected.
Raises Empty
if the queue is empty.
pop_c q
: Takes the first element x
from the queue, removes it
there, and returns a copy of x
in normal memory.
Raises Empty
if the queue is empty.
pop_p q f
: Takes the first element x
of the queue,
and calls f x
, without removing x
from the queue.
During the execution of f
the value x
is pinned and cannot be garbage-collected.
Raises Empty
if the queue is empty.
pop_p q f
: Takes the first element x
of the queue,
and calls f x
, without removing x
from the queue.
Returns a copy of x
in normal memory.
Raises Empty
if the queue is empty.
iter f q
: Iterates over the elements of the queue and calls f x
for each element x
. The function considers the list of elements
at the time of calling iter
as the list to iterate over. The
queue is not locked during the iteration, and hence elements can be
popped from the queue and pushed to the queue in parallel. The
iteration does not take these modifications into account, though.
The elements x
are pinned during the execution of f
and will
not be garbage-collected, even if a parallel pop
removes them from
the queue.
Look up the queue for this descriptor