Function WorkStealingDeque.stealBatch

Attempts to steal a bounded batch into caller-owned output storage.

size_t stealBatch(
  scope T[] output
) nothrow @nogc @safe;

Values are written in thief/FIFO order starting at output[0].

Parameters

NameDescription
output caller-owned destination slice; its length limits the maximum number of values removed

Returns

Number of values written to output. Zero means no batch was available or another operation prevented this steal from claiming work.

Failure

A zero result does not modify caller output beyond its prior contents.

Thread Safety

May be called concurrently by multiple thief threads and concurrently with the single owner.

Allocation

None.