Repository navigation
spin v0.1.6 -- Pause semantics and CI maintenance #11
hayabusa-cloud
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Introduction
Package
spinprovides minimal spin primitives for performance-critical Go code paths:Lockfor ultra-short critical sections,Waitfor adaptive polling,Pausefor architecture-specific CPU pause hints, andYieldfor cooperative yielding outside hot paths. It is designed for code where allocation, scheduler overhead, and avoidable cache-line traffic matter.Lockremains intentionally non-fair and specialized; general-purpose mutual exclusion should still usesync.Mutex.Waitgives callers a compact adaptive backoff surface, moving from pause hints toward scheduler cooperation as a polling loop ages.Pauseexposes the lowest-level CPU hint operation while preserving a compact, allocation-free hot-path surface.Yieldstays the explicit escape hatch for non-hot paths that should give other goroutines time to run.Usage
Highlights
This patch clarifies the public wording around
Pause(cycles):cyclesis a repeat count for pause hints, not a calibrated CPU-cycle delay. The documentation now states the hardware and fallback behavior explicitly, so callers can distinguish hardware-pause targets from wasm and unsupported fallback targets.What's Changed
Documentation
Pause(cycles)GoDoc and multilingual README wording: the default is 30 pause hints,cyclesis a repeat count, and fallback targets may yield throughruntime.Gosched()(refactor: documents clarification #10)Chore
Compatibility
This discussion was created from the release spin v0.1.6 -- Pause semantics and CI maintenance.
All reactions