Re:Simple coroutines for games in C++
by jasonjei on Sunday March 20, 2016 @03:49PM
(#11324339)
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...
[ Parent
| on HN ]
Linux for one doesn't unless you count the obsolete (and slow) swapcontext.
Google implemented fibers. Hopefully they'll get upstreamed.
If 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
You can use this: http://libmill.org