3 ms·
Question: couldn't you use OS fibers to do "coroutines" without being resource intensive? I know all major OS kernels have supported fibers for some time...
by jasonjei 11y ago
Question: couldn't you use OS fibers to do "coroutines" without being resource intensive? I know all major OS kernels have supported fibers for some time...
- gpderetta 11y agoLinux for one doesn't unless you count the obsolete (and slow) swapcontext.
- acconsta 11y agoGoogle implemented fibers. Hopefully they'll get upstreamed. https://www.youtube.com/watch?v=KXuZi9aeGTw https://www.youtube.com/watch?v=KXuZi9aeGTw
- gpderetta 11y agoIf I remember correctly, that's an additional interface for usermode initiated, cooperative scheduling of kernel threads (basically a variant of pthread_yield that allows specifying which thread is going to get the timeslice we are relinquishing). It still requites a syscall and the entities being scheduled are proper kernel level threads. So not really fibers. Pretty cool though. Edit: autocorrect
- rumcajz 11y agoYou can use this: http://libmill.org http://libmill.org