2 ms·
I don't think "fiber" has a universally agreed definition, which makes these things super confusing to read without clarification. It's hard to come up with a g
by scottlamb 7y ago
I don't think "fiber" has a universally agreed definition, which makes these things super confusing to read without clarification. It's hard to come up with a good definition and stick to it because people keep coming up with new variations.
An interesting case is a different Google fiber library, not open-sourced but described in a public talk. [1] Real kernel threads but (mostly) scheduled in userspace via new syscalls [2] that suspend the current thread and unsuspend a userspace-chosen other thread. The idea is that most of the overhead of kernel threads is the scheduling and userspace has the ability to make a quick good choice. [3] Thus you can get most of the CPU performance of an async implementation but the relatively easy-to-read callback-free code of a threaded implementation. Anyway, people can disagree on what to call such a combination.
[1] https://www.youtube.com/watch?v=KXuZi9aeGTw https://www.youtube.com/watch?v=KXuZi9aeGTw
[2] the rseq stuff described in that talk has been upstreamed [4] but the switchto stuff still hasn't.
[3] I'm not sure if the performance argument is as strong since the Meltdown/Spectre mitigations added to the performance cost of any syscall.
[4] https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ https://www.efficios.com/blog/2019/02/08/linux-restartable-s...