Repository navigation
docs(design): lock-free MPSC drain_parallel alternative (#1681) - #4219
Merged
Merged
Conversation
Design note for the lock-free MPSC variant of WorkQueueReceiver::drain_parallel. Sketches the crossbeam_channel swap, documents the ordering contract delegated to ReorderBuffer, defines the 20% threshold on the #4214 drain_parallel_alternatives bench that gates the migration, and lays out a feature-flag rollout plan. Recommendation is to defer the implementation until the #4214 numbers land on the reference host. Cross-refs #4170, #4173, #4203, #4214.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Design note for the lock-free MPSC variant of WorkQueueReceiver::drain_parallel. Sketches the crossbeam_channel swap, documents the ordering contract delegated to ReorderBuffer, defines the 20% threshold on the #4214 drain_parallel_alternatives bench that gates the migration, and lays out a feature-flag rollout plan. Recommendation is to defer the implementation until the #4214 numbers land on the reference host. Cross-refs #4170, #4173, #4203, #4214.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Design note for the lock-free MPSC variant of WorkQueueReceiver::drain_parallel. Sketches the crossbeam_channel swap, documents the ordering contract delegated to ReorderBuffer, defines the 20% threshold on the #4214 drain_parallel_alternatives bench that gates the migration, and lays out a feature-flag rollout plan. Recommendation is to defer the implementation until the #4214 numbers land on the reference host. Cross-refs #4170, #4173, #4203, #4214.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Design note for the lock-free MPSC variant of WorkQueueReceiver::drain_parallel. Sketches the crossbeam_channel swap, documents the ordering contract delegated to ReorderBuffer, defines the 20% threshold on the #4214 drain_parallel_alternatives bench that gates the migration, and lays out a feature-flag rollout plan. Recommendation is to defer the implementation until the #4214 numbers land on the reference host. Cross-refs #4170, #4173, #4203, #4214.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/design/lockfree-mpsc-drain-design.mdcovering the lock-free MPSC alternative to the shardedMutex<Vec>collector inWorkQueueReceiver::drain_parallel.crates/engine/src/concurrent_delta/work_queue/drain.rs:57-90and the existing collector contention bench atcrates/transfer/benches/parallel_stat_collector_contention.rs(bench: profile Arc<Mutex<Vec>> contention in parallel-stat path (#1192) #4170).crossbeam_channel::unboundedsketch that preserves the public API, the rayon work-stealing dispatch, and the bounded-queue backpressure, and notes that ordering stays delegated toReorderBuffer(no extra sort phase needed).drain_parallel_alternativesbench from PR bench(engine): drain_parallel alternatives at 10K/100K items (#1682) #4214: MPSC must be >= 20% faster than the sharded mutex at T=8 and T=16 with no > 5% regression at T=4 before we migrate.Test plan
cargo fmt --all -- --check