Struct WorkStealingDeque
Fixed-capacity work-stealing deque for one owner and zero or more thieves.
struct WorkStealingDeque(T, ulong Capacity);
The owner may call tryPush and pop. Thief threads may call steal and
stealBatch. Calling owner-only operations from more than one thread
violates the concurrency protocol even though the operations are @safe.
The deque transports trivial atomic value representations; it does not own referenced objects. Pointee lifetime and reclamation remain the caller's responsibility.
The deque never resizes and performs no scheduler policy when full.
is a valid empty deque.
Methods
| Name | Description |
|---|---|
pop
()
|
Owner-only LIFO removal. |
steal
()
|
Thief-safe single-item FIFO removal from the opposite end. |
stealBatch
(output)
|
Thief-safe bounded batch steal. |
tryPush
(item)
|
Owner-only insertion. |
Parameters
| Name | Description |
|---|---|
| T | trivial atomically transportable shared-compatible value representation with no destructor/postblit ownership semantics |
| Capacity | compile-time element capacity; power of two in [2, 2^61] |
Allocation
Construction and steady-state operations perform no backing allocation.
Thread Safety
Exactly one owner thread may call tryPush/pop; zero or more thief
threads may call steal/stealBatch concurrently.
Identity
Copy construction, move construction and assignment are disabled. Establish the deque at its final address before concurrent use.