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

A clarification: Rust async/await stacks do not move or change size. They are fixed to the size of a static call graph and are pinned in place. (Going beyond that can be done with explicit heap allocation, but it's extremely rare in practice.)

This is, from what I can tell, their main advantage in performance over other implementations. (In Rust, at least- the performance story may easily be different in garbage collected languages like Go or Java.)

Another caveat: Rust's claims to have implemented M:N in the past must be tempered a bit by two factors. First, Rust had to use segmented stacks, which Go moved away from and which Loom seems to be avoiding, precisely because they're so expensive. Second, Rust had to dispatch all IO APIs dynamically based on the currently selected runtime, which Go avoids by not having two runtimes, and which Loom can probably avoid via its scheduler implementation and/or JIT devirtualization.



Early Rust used M:N exclusively and didn't need dynamic dispatch for I/O.


...but a large part of the reason to ditch M:N was the overhead it added to 1:1-style IO in a language quickly moving toward the C++ space.

They didn't decide to move off of M:N when it was exclusively M:N.


I was in the meetings where the decisions were made. The decision to add 1:1 in the first place was because of performance problems with M:N.




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

Search: