
Am 13.04.2012 19:21, schrieb Mathias Gaunard:
On 13/04/12 18:28, Oliver Kowalke wrote:
Am 13.04.2012 18:05, schrieb Mathias Gaunard:
AFAIK the HPX library, done by several people associated to Boost, uses code derived from the old Boost.Coroutine for context switching. Boost.Coroutine from Giovanni uses ucontext_t on UNIX.
This is incorrect. ucontext is just one of the provided implementations. There is also custom assembly for x86.
<https://svn.boost.org/svn/boost/sandbox/SOC/2006/coroutine/trunk/libs/coroutine/src/>
what about the other architectures? and has to save/restore the registers as the call conventions require (and fcontext does). Why should it then be faster? At a brief look it does not preserve the SSE2 control and status word as well as it does not preserve x87 control word. If you do not take care about the calling convention and ignore to preserve some relevant data of course you can be faster (but it is incorrect code and might fail).