30 Apr
2013
30 Apr
'13
3:48 p.m.
2013/4/30 Niall Douglas
As Oliver noted you could take a look at Boost.Fiber and Boost.Task.
Right now anything Boost.Context based can't have multiple contexts simultaneously entering the kernel apart from on QNX and possibly Hurd. Therefore, for the time being, full fat threads are the only thing being considered. If kernel support ever includes coroutines or fibres, that will be eagerly added (I like coroutines, I use them a lot on Python).
the idea of coroutines/fibers is that the context switche do not involve the kernel - usually a context switch with coroutiens on x86 takes ca. 40 cycles - switches with threads (which require syscalls into the kernel) require ca. 1000 cpu cyles.