Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> and async isn't a language feature the kernel will use

Why not thought? Lots of drivers could benefit from async to simplify their state machine as they wait for interrupt for example.



One could try to use it for those use-cases, but it probably warrants some investigation if it's actually the best possible solution for the problem.

The kernel has some different properties than userspace - e.g. context switches between kernel threads can already be cheap, which minimizes some of the reasons for using async/await. Then allocations for continuations using in-kernel slab allocators might also be cheaper then in userspace, whereas placing huge objects (Future)s on the stack (preferred mode of Rust Future composition) might be more expensive with tiny kernel stacks.

I guess it might be worth to do experiments for some use-cases to see how it actually would work out.


Async is very good for only a specific kind of of state machine graph that isn't nearly as prevalent outside of network services.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: