• 0 Posts
  • 14 Comments
Joined 2 个月前
cake
Cake day: 2026年8月19日

help-circle





  • The crate thing is how you get Tokio defaultism, and a lack of runtime agnosticism

    If only there was some kind of way for all libraries to be parameterized over the runtime…

    I don’t have it in me to do research on that today, but figuring out which types of programs would benefit from [kernel-managed M:N thread type things] and what the limitations are is an interesting question. In practice, the kernel will never know as much about your code as a language-specific runtime.

    With the “kernel vs userspace for $thing” question, it’s faster to “stay where you already are”. Context switches are expensive. And it seems really hard/awkward to schedule from the kernel without yield points being extra context switches. With old-skool poll-based I/O, you could maybe try to attach the next task choice onto the poll syscall itself but that would only improve the situation for the tasks that are directly waken up by external events (like socket readiness). Bouncing from one task to another would still be “extra” poll calls then.

    Now that Linux has realized that completion-based I/O scales a lot better, we’re firmly in the “fewer syscalls actually” territory…


    score 1 · canonical