News for hackers. Stuff that matters.
Re:Fibers: An Elegant Windows API by elteto on Friday March 29, 2019 @11:18AM (#19522409)
That's too bad indeed. How would one implement coroutines in Linux/Unix today then?
Re:Fibers: An Elegant Windows API by spc476 on Friday March 29, 2019 @07:31PM (#19526492)
Usually using C's `setjmp()` and `longjmp()` functions (but I consider that an ugly hack). I did an implementation for both x86-32 and x86-64 [1] that works for Linux and Mac OS-X that's for C (written in assembly). I doubt it will work for C++, and I'd be a bit hesitant to use it for production, but it's surprisingly simple.

[1] https://github.com/spc476/C-Coroutines

Edit: clarification of what language my coroutines are implemented in.

Re:Fibers: An Elegant Windows API by thestoicattack on Friday March 29, 2019 @02:15PM (#19524135)
I guess wait for libstdc++ to implement the Coroutines TS that got merged into the C++20 standard?
Re:Fibers: An Elegant Windows API by sanxiyn on Friday March 29, 2019 @11:52AM (#19522707)
Python's greenlet extension implements coroutine using inline assembly, which has been widely ported (at least ARM and x86, both 32-bit and 64-bit). It's nicely packaged so that you can use it without Python part.
Re:Fibers: An Elegant Windows API by gpderetta on Friday March 29, 2019 @12:37PM (#19523194)
boost has a coroutine api. It provide both low level (untyped C-like) and high level APIs.