Repository navigation
spin v0.1.1 — low-latency spin primitives for Go
Overview
spin provides small, low-latency spin-based primitives for performance-critical Go code paths.
Highlights
Lock: a minimal, non-fair spinlock designed for extremely short critical sections.Wait: an adaptive spin-wait helper that escalates from CPU pause hints to cooperative scheduler yields.Pause: an architecture-specific CPU hint intended for tight busy-wait loops; it must not block or yield the scheduler.
Platform support
Optimized implementations are provided on common architectures, with broad multi-arch support:
amd64, arm64, 386, arm, riscv64, ppc64le, s390x, loong64.
Notes
Lockis intentionally non-fair and is not a general-purpose replacement forsync.Mutex.- For polling loops, prefer
WaitorPauseover ad-hocruntime.Gosched()loops.
Installation
go get code.hybscloud.com/spinChangelog
- CI: Fixed Codecov reporting by uploading the generated Go coverage profile during the Linux/amd64 coverage job.