3 ms·
Question: The author of the 9P server module "created an executor that can run async code in a kernel workqueue"; is this made a lot easier by the fact that Rus
by davidatbu 4y ago
Question: The author of the 9P server module "created an executor that can run async code in a kernel workqueue"; is this made a lot easier by the fact that Rust doesn't include an async executor as part of the core/stdlib?
- JoshTriplett 4y agoThe work on Rust in the Linux kernel doesn't include the standard library, and even if it did, having an executor around doesn't prevent you from creating and using a different one.
- davidatbu 4y agoThank you!
- estebank 4y agoI think they are pointing out that because the Rust design has decoupled the functionality from the implementation, these kind of replacements are even possible in the first place. Of course, if you use an alternative executor there are large swaths of the (non-std) async ecosystem that are not available to you (thinking of anything like relying on a tokio::timer::Delay as an example). But as you point out Rust in the Linux kernel already doesn't rely on the std, so they wouldn't even begin to imagine to use an off the shelf crate and expect it to work unmodified for their use case. I just think it is worth pointing out that this is a constraint we currently have.
- davidatbu 4y agoYou're better at expressing my thoughts than I am :)
- littlestymaar 4y agoestebank reads other people's mind, that's why he's so good at writing helpful compiler errors.
- estebank 4y agoThank you, you're too kind. I don't know how much that experience of "make the compiler try to talk to a human in a way they can understand it" translates to other parts of life, though :)
- JoshTriplett 4y agoRight, yes: if we had a design that built a single executor into the language or we had a runtime that included it, you wouldn't be able to replace that as easily. Because executors are, at most, a library mechanism, you can always replace them or run more than one.
- colonwqbang 4y agoIt doesn't in rust but in many other languages there would have been a single blessed async library and trying to use anything else would have been very painful. The fact that rust doesn't particularly force the use of it's standard runtime is key to why rust is useful for kernel work.
- brundolf 4y agoYeah, but I think what they're getting at is that Rust could provide a standard executor in the library and also be modular enough that you can use whichever one you want. The questions are orthogonal
- deleted 4y ago[deleted]