You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asyncband.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2026/09/07 18:54:08 UTC

[PR] perf(mpsc): separate bounded waiting and unbounded reclamation [asyncband]

tisonkun opened a new pull request, #290:
URL: https://github.com/apache/asyncband/pull/290

   ## Summary
   
   Reduce MPSC contention and bound storage retained after unbounded bursts without changing the public API, capacity accounting, or cancellation semantics.
   
   - Separate bounded send retries from semaphore permit accounting and skip notifications when no endpoint is waiting.
   - Reclaim unbounded storage in 32 KiB segments while retaining batched receiving and a small reusable buffer cache.
   - Complete bounded disconnection cleanup across callback panics, count unpublished reservations toward capacity, and cover waker reentrancy and cancellation races.
   
   ## Design Notes
   
   The ring remains the authority for bounded capacity. A pending sender owns a cancellable retry registration; cancelling a notified sender forwards its unused notification. Receiver notifications keep the existing atomic ownership state machine, with a hint and paired SeqCst fences to avoid unnecessary updates without losing publication races. Ring consumption remains exclusive to the non-cloneable receiver.
   
   Unbounded storage has a writable segment, sealed FIFO segments, and a receiver-owned batch. Full replacement segments are allocated only after a rollover demonstrates demand. Consumed segments are reclaimed incrementally, and empty storage no longer tracks peak occupancy. Payload and waker callbacks run outside channel mutexes.
   
   Validation: `cargo x test`, `cargo x check`, `cargo x lint`, and four-seed Miri covering library, oneshot, unsafe-path, and 17 MPSC protocol tests. The eight MPSC tests requiring an OS-backed Tokio runtime remain covered by native tests. Five-round ablations compare merged main and the former std backend; the expanded benchmarks also cover capacities 1/64/4096, persistent workers, current-thread and multi-thread Tokio runtimes, and ecosystem implementations.
   
   Follow-up to #247.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org


Re: [PR] perf(mpsc): separate bounded waiting and unbounded reclamation [asyncband]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #290:
URL: https://github.com/apache/asyncband/pull/290#issuecomment-5579187406

   Merging for benchmark cases. I have a new idea for mpsc implementation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org


Re: [PR] perf(mpsc): separate bounded waiting and unbounded reclamation [asyncband]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #290:
URL: https://github.com/apache/asyncband/pull/290


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org