3 ms·
I wouldn't call it elegant at all, the convertthreadtofiber is a pain for a library. I like swapcontext much more in theory. In practice the issue with swapcon
by gpderetta 8y ago
I wouldn't call it elegant at all, the convertthreadtofiber is a pain for a library. I like swapcontext much more in theory.
In practice the issue with swapcontext is that it does not integrate well with the rest of posix (what happens if you move a fiber to another thread?) and the requirements to restore the signal mask pretty much require a very slow implementation.
On the other hand, Windows Fibers are somewhat efficient (one can still do significantly better), but most importantly, the interaction with the rest of the system is well understood.
I wrote my thoughts on the API here about (/checks calendar) 13 years ago: http://www.crystalclearsoftware.com/soc/coroutine/coroutine/fibers.html http://www.crystalclearsoftware.com/soc/coroutine/coroutine/...