Expand description
Cross-platform CPU core pinning for controlled measurements.
Pinning the producer and consumer to fixed, distinct cores removes
the run-to-run scheduler variance that otherwise swamps small
cache-coherence effects in a 1P/1C throughput measurement. The
function is best-effort: it returns false (leaving the thread on
the OS default) on platforms without a supported affinity API, so
a caller can report that its measurement was uncontrolled rather
than silently trusting a noisy number.
Functionsยง
- pin_
current_ thread_ to_ core - Pin the calling thread to a single logical core. Returns
trueif the affinity was actually set.