News for hackers. Stuff that matters.
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...
Re:Simple coroutines for games in C++ by gpderetta on Sunday March 20, 2016 @04:17PM (#11324457)
Linux for one doesn't unless you count the obsolete (and slow) swapcontext.
Re:Simple coroutines for games in C++ by acconsta on Sunday March 20, 2016 @09:40PM (#11325668)
Google implemented fibers. Hopefully they'll get upstreamed.

https://www.youtube.com/watch?v=KXuZi9aeGTw

Re:Simple coroutines for games in C++ by gpderetta on Monday March 21, 2016 @06:34AM (#11327165)
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

Re:Simple coroutines for games in C++ by rumcajz on Monday March 21, 2016 @01:53AM (#11326452)
You can use this: http://libmill.org