EXPERIMENT: mesh/pal: Use async_channel instead of futures::channel#2585
Closed
smalis-msft wants to merge 2 commits intomicrosoft:mainfrom
Closed
EXPERIMENT: mesh/pal: Use async_channel instead of futures::channel#2585smalis-msft wants to merge 2 commits intomicrosoft:mainfrom
smalis-msft wants to merge 2 commits intomicrosoft:mainfrom
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Contributor
There was a problem hiding this comment.
Pull request overview
This experimental PR migrates from futures::channel to async_channel across the mesh and pal subsystems to potentially improve performance characteristics. The changes replace oneshot channels with bounded(1) channels and unbounded mpsc channels with async_channel equivalents.
Key changes:
- Replace
futures::channel::oneshotwithasync_channel::bounded(1) - Replace
futures::channel::mpsc::unboundedwithasync_channel::unbounded - Update method calls from
unbounded_send()tosend_blocking()orsend().await
Critical compilation issues identified:
async_channel::Receiverdoes not implement theStreamtrait, causing compilation failures where.next()or.poll_next()are called on receivers- Two locations affected:
alpc_node.rsline 233 and existing code dependent on changes inlocal_node.rsline 2494
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Removes futures-channel workspace dependency |
| Cargo.lock | Updates dependencies: adds async-channel to mesh_node, mesh_remote, and pal_uring |
| support/mesh/mesh_node/Cargo.toml | Replaces futures-channel with async-channel dependency |
| support/mesh/mesh_node/src/local_node.rs | Replaces oneshot and mpsc channels with async_channel; adds explicit close() call for shutdown signaling |
| support/mesh/mesh_remote/Cargo.toml | Adds async-channel dependency |
| support/mesh/mesh_remote/src/alpc_node.rs | Converts mpsc::unbounded to async_channel with Stream usage that won't compile |
| support/mesh/mesh_remote/src/unix_node.rs | Converts mpsc channels to async_channel; changes send operations from non-blocking to async |
| support/pal/pal_async/src/executor_tests.rs | Converts oneshot test channels to bounded(1) async_channel |
| support/pal/pal_uring/Cargo.toml | Adds async-channel as dev-dependency |
| support/pal/pal_uring/src/threadpool.rs | Converts test oneshot channels to bounded(1) async_channel |
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.
We generally believe that async_channel has better performance characteristics than futures channels, but the semantics are slightly different. Let's see what happens here.
Also move one channel in netvsp from futures to mesh, since it was unbounded and doesn't need any of futures' semantics.