ForkJoin::WorkDeque
Bounded single-producer, multi-consumer run queue.
The owning scheduler publishes into the ring and every scheduler may consume from its head. A packed pair of head indices lets one thief claim a batch before copying it into its own queue, while the owner continues to consume work beyond the claimed range.
Constants
Instance methods
Publishes an owner-claimed injection batch. The caller limits the batch to the currently available first half of the ring.
Keep one continuation as the owner's next runnable fiber. Additional continuations enter the stealable ring so they can run in parallel.
Fresh local work uses a single LIFO slot. Displacing the previous entry into the FIFO ring preserves locality without allowing a local producer to monopolize the worker indefinitely.
Race-free emptiness check of the stealable ring only, safe to call from
any thread. The owner's private slots (@lifo, @handoff) are not read
because only the owner may observe them.
Claims approximately half of this queue and transfers the batch into the thief's queue. One transferred fiber is returned immediately.