Reading a bit about Go's goroutine scheduler. Sounds like it tries to solve many of the same problems a GPU's shader core does. # threads ("goroutines") >> # of simds ("OS threads"), fast switching, small stacks, minimal fairness, turn blocking calls into async calls.
-
-
Windows and macOS have no stable kernel API outside the system API, so that means every syscall needs a switch to a big stack. This huge cost usually outweighs all the gains of M:N. It killed M:N threading as a general solution in Rust.
-
M:N threading is still useful for CPU-bound task-parallel kernels. For that we have Rayon/GCD/etc, on in opt-in basis. Note that these frameworks are stackless (so OS library incompatibility isn’t a problem) and don’t try to multiplex I/O.
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.