pub struct WorkloadShape {
pub n_thieves: usize,
pub batch_size: Option<usize>,
pub wait_idle: bool,
}Expand description
Caller-supplied workload shape feeding the routing decision.
Fields§
§n_thieves: usizeNumber of consumer threads / processes that will drain the
deque concurrently. >= 2 is the multi-thief regime where
URD’s per-mailbox layout amortizes against the shared-head
CAS contention Chase-Lev / KHPD / LOH all pay.
batch_size: Option<usize>Some(K) when the producer hands the dispatcher a batch of
K items per call; None when the producer dispatches one
item at a time (request-reply / latency-bound).
wait_idle: booltrue when the consumer should halt the logical CPU between
batches (WAITPKG on capable silicon; PAUSE-spin elsewhere).
Setting this routes to URD even at n_thieves == 1.
Implementations§
Source§impl WorkloadShape
impl WorkloadShape
Sourcepub const fn required_signature(&self) -> AxisMask
pub const fn required_signature(&self) -> AxisMask
The direction signature this workload requires from its transport: which K-axes the variant must engage to handle this shape.
Per-item dispatch (no batch) requires nothing beyond the empty signature (Chase-Lev’s signature is a superset of any empty requirement). Batched dispatch requires K_inner + K_outer engaged (per-slot packing AND per-batch counter amortization). Multi-thief or wait-idle requires K_consumer + K_radius engaged (per-thief mailboxes and CPUID-dispatched publish mechanism).
Sourcepub fn request_reply() -> Self
pub fn request_reply() -> Self
Request-reply: per-item dispatch, single thief, no idle wait.
Sourcepub fn producer_fast(k: usize) -> Self
pub fn producer_fast(k: usize) -> Self
Producer-fast batch of k items, single thief.
Trait Implementations§
Source§impl Clone for WorkloadShape
impl Clone for WorkloadShape
Source§fn clone(&self) -> WorkloadShape
fn clone(&self) -> WorkloadShape
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more