Skip to content

spin v0.1.1 — low-latency spin primitives for Go

Choose a tag to compare

@hayabusa-cloud hayabusa-cloud released this 14 Dec 16:52
· 16 commits to main since this release
c421d82

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

  • Lock is intentionally non-fair and is not a general-purpose replacement for sync.Mutex.
  • For polling loops, prefer Wait or Pause over ad-hoc runtime.Gosched() loops.

Installation

go get code.hybscloud.com/spin

Changelog

  • CI: Fixed Codecov reporting by uploading the generated Go coverage profile during the Linux/amd64 coverage job.