Subject: Re: [boost] review request for boost.context
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2010-07-28 10:46:44
Am 28.07.2010 16:34, schrieb Hartmut Kaiser:
> On Windows I'd suggest to fall back to CreateFiber/SwitchToFiber/etc. These
> functions are not kernel calls, but merely do the context
> creation/switching. In my experience, it is almost impossible to convince
> the MSVC C++ runtime libraries to behave properly if you use your own
> context switching assembly code. OTOH, the measurements we performed shows
> SwitchToContext being to almost as fast as the hand written assembly code we
> were using in the beginning.
I find the Win32 Fiber interface ugly - at least the need to call
ConvertThreadToFiber() and ConvertFiberToThread(). Until VISTA you had
no Function which tells you if you already running in a fiber or not.
You could fall back only to some heuristics.
The TIB is not changed (only the pointers pointing to the limit and base
of the stack). Ofcourse a new SEH chain has to be created and installed
for each new context.
So I'd like to know which problems did you encounter with own context
switching code and MSVC C++ runtime libs.
AFAIK migrating Win32 Fibers between threads is not possible and cloning
also not - but maybe I'm wrong in this point.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk