This repository was archived by the owner on Sep 8, 2025. It is now read-only.
combine fiber abstractions from async_.rs and concurrent.rs#223
Merged
Conversation
dicej
commented
Jun 18, 2025
| // in Rust is all about, though, right? | ||
| unsafe impl Send for StoreFiber<'_> {} | ||
| // SAFETY: TODO | ||
| unsafe impl Sync for StoreFiber<'_> {} |
Collaborator
Author
There was a problem hiding this comment.
@alexcrichton I added this a long time ago to appease the compiler, but it deserves a second look. I can either try to remove the need for this (e.g. wrap it in a Mutex wherever we store it in concurrent.rs) or write another lengthy comment that justifies it similar to the Send impl above. What do you think?
edddc3b to
9f22eda
Compare
A long time ago, when I first started implementing CM async, I cut-and-pasted `async_.rs`'s `FiberFuture` as `StoreFiber` and heavily modified it. Both have evolved separately since then, and now that the CM async work has generally stabilized it's time to unify them. This creates a new `runtime::fiber` submodule which `async_.rs` and `concurrent.rs` share. The central type is `StoreFiber`, which is a more versatile version of `FiberFuture`, supporting fibers which can either retain exclusive access to the store across suspend points or release it, allowing the store to be used by the root event loop and/or other fibers to run before the original fiber resumes. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
9f22eda to
89e49e1
Compare
Collaborator
Author
|
I'll go ahead and merge this; feel free to comment here anyway -- I can address any issues in follow-up PRs. |
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
ae04b01 to
f049bef
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A long time ago, when I first started implementing CM async, I cut-and-pasted
async_.rs'sFiberFutureasStoreFiberand heavily modified it. Both have evolved separately since then, and now that the CM async work has generally stabilized it's time to unify them.This creates a new
runtime::fibersubmodule whichasync_.rsandconcurrent.rsshare. The central type isStoreFiber, which is a more versatile version ofFiberFuture, supporting fibers which can either retain exclusive access to the store across suspend points or release it, allowing the store to be used by the root event loop and/or other fibers to run before the original fiber resumes.