Repository navigation
enough 0.4.5
Added
AsStopReason: theStopReasonan error represents, if any;StopReasonimplements it (7e3fd28)live()ondyn Stopand its+ Send/+ Send + Syncforms: the stop, orNoneif it can never stop, for checking a&dyn Stopin a hot loop (ae5d376)
Changed
Stop::check,should_stopand the forwarding impls are#[track_caller], so an instrumented stop can attribute a poll to its call site; no signature change (5caac7e)- The crates.io page is this crate's own README, whose examples compile as doctests, instead of the workspace README (bd674e8, 5b8315d, 3909cea)
almost-enough 0.4.5
Added
PollMeter<S>behind the opt-inpoll-meterfeature: per-call-site histograms of the gaps between polls, flagging slow gaps and poll storms;StopExt::metered()wraps any stop (2236d17, 5caac7e)DebouncedTimeout::clear_calibration(): the next two checks read the clock and set how often it is read; calibration, at creation too, now times two consecutive checks (af0eaef)
Changed
cancel()is a Release swap andis_cancelled()an Acquire load onStopper,StopSource,ChildStopperandSyncStopper, so a thread whoseis_cancelled()returns true sees what was written before the cancel it observed; checks are unchanged (4fd6dbd)ChildStopperwalksChildStopperparents without a vtable call per level; each node is 8 bytes larger (5283eda)StopTokendrops itsSyncStopperarm, socheckis two branches instead of a jump table on x86-64 (5d53d06)BoxedStopwraps aStopTokenand takes its fast paths; still notClone(d2e41e8)StopToken::from_arc(Arc<Stopper>)checks the flag directly, asStopToken::newdoes; anArc<SyncStopper>stays behind the vtable (c5d4d6c)PollMeterlooks call sites up byLocationaddress: 693 → 308 instructions per poll (a37d1cd)- README: library functions take
Option<&dyn Stop>, or aStopTokento store or thread the stop, instead ofimpl Stop; one line on each type to reach for (70302bf) - Requires
enough0.4.5 (5b8315d)
Deprecated
BoxedStopandStopExt::into_boxed, in favor ofStopTokenandinto_token()(97d04f9)
Fixed
allocturns onenough'salloc, soBox<dyn Stop>andArc<dyn Stop>are stops in a build that uses only almost-enough (667b66b, 22cb41a)DebouncedTimeoutreads the clock at least every 64 checks, so a slowdown can no longer make it stop seconds to a minute late; once one thread sharing it times out, every later check stops (e152409)- Docs:
WithTimeoutstates its per-check clock read,DebouncedTimeout's calibration is described, and every README example compiles (0ca1e56, 69eb567)
What's Changed
- docs(enough): show how to construct + flip a real cancellation token by @lilith in #11
- docs(almost-enough): add install/version + cross-thread cancel example + Send/Sync by @lilith in #12
- docs: enough-tokio consumer deps + enough-ffi from_ptr type/null/thread-safety contracts by @lilith in #13
- perf(almost-enough): BoxedStop shares StopToken's dispatch by @lilith in #29
- perf(almost-enough): PollMeter looks call sites up by Location address by @lilith in #32
- perf(enough-tokio): TokioStop reads an atomic flag once it is checked often by @lilith in #28
- feat(enough): dyn Stop::live, the stop or None when it can never stop by @lilith in #34
- feat(enough): AsStopReason, the StopReason an error represents by @lilith in #40
- chore(almost-enough): deprecate BoxedStop in favor of StopToken by @lilith in #35
- perf(almost-enough): StopToken drops its SyncStopper arm, so check has no jump table by @lilith in #36
- feat(almost-enough, enough-ffi): Release cancel(), Acquire is_cancelled(); checks unchanged by @lilith in #30
- perf(almost-enough): ChildStopper walks ChildStopper parents without vtable calls by @lilith in #38
- fix(almost-enough): bound how late DebouncedTimeout stops after checks slow down by @lilith in #31
- feat(almost-enough): DebouncedTimeout::clear_calibration by @lilith in #42
- test(almost-enough): PollMeter's histogram test without sleeps by @lilith in #41
- docs: WithTimeout's per-check cost, a README example that compiles, StopToken's size by @lilith in #37
- bench: measurement records for #30, #31, #38 and #42 by @lilith in #39
- release: enough 0.4.5, almost-enough 0.4.5, enough-ffi 0.4.1, enough-tokio 0.5.1 by @lilith in #43
Full Changelog: v0.4.4...v0.4.5