
I've uploaded a new version which takes care of the FLS on Windows. Oliver

On 7/29/2010 6:30 AM, Oliver Kowalke wrote:
I've uploaded a new version which takes care of the FLS on Windows.
Oliver
I'm finding the documentation a bit...skeletal. I don't have a lot of hands-on experience with contexts, coroutines, fibers, etc., so I think some real examples would go a long way. Several questions: Is the typical usage to grab the current context, then jump to some other (previously constructed) context? What would be the recommended method for the second context to transfer control back to the original one? Is this functionality basically what the coroutine and fiber library are suppose to take care of? Does this library have any use by itself, or would one primarily use this to build a fiber/coroutine library on top? Is context switching significantly different on the various Windows flavors, or have you just not gotten around to testing on Vista and 7 (it seems only XP is documented as working)? Thanks for having patience with the n00b questions, - Jeff

Am 29.07.2010 23:40, schrieb Jeffrey Lee Hellrung, Jr.:
On 7/29/2010 6:30 AM, Oliver Kowalke wrote: so I think some real examples would go a long way
in libs/context/example you find a simple example
Several questions: Is the typical usage to grab the current context, then jump to some other (previously constructed) context?
yes
What would be the recommended method for the second context to transfer control back to the original one?
simply jump to it : this_context.jump_to( original_context);
Is this functionality basically what the coroutine and fiber library are suppose to take care of?
It is the base of coroutine, fiber etc. The libraries build on top of boost.context usualy provide more functionality like scheduling, result and error transfer ...
Does this library have any use by itself, or would one primarily use this to build a fiber/coroutine library on top?
You can build your own cooperative scheduling libraries (coroutine and fiber are only examples) with boost.context.
Is context switching significantly different on the various Windows flavors, or have you just not gotten around to testing on Vista and 7 (it seems only XP is documented as working)?
It's not different - I've not Vista or Windows7. Oliver

On 7/29/2010 9:44 PM, Oliver Kowalke wrote:
Am 29.07.2010 23:40, schrieb Jeffrey Lee Hellrung, Jr.:
On 7/29/2010 6:30 AM, Oliver Kowalke wrote: so I think some real examples would go a long way
in libs/context/example you find a simple example
Thanks.
Several questions: Is the typical usage to grab the current context, then jump to some other (previously constructed) context?
yes
What would be the recommended method for the second context to transfer control back to the original one?
simply jump to it : this_context.jump_to( original_context);
So, naturally, you have to pass some reference of the original context to the second one via the void* parameter, right? There's no magic way to grab the context from which one came, or is there?
Is context switching significantly different on the various Windows flavors, or have you just not gotten around to testing on Vista and 7 (it seems only XP is documented as working)?
It's not different - I've not Vista or Windows7.
Perhaps I will try this out then (Windows7). Thanks for your answers, - Jeff

Am 30.07.2010 07:00, schrieb Jeffrey Lee Hellrung, Jr.:
What would be the recommended method for the second context to transfer control back to the original one?
simply jump to it : this_context.jump_to( original_context);
So, naturally, you have to pass some reference of the original context to the second one via the void* parameter, right?
yes - but if you want that the original context get executed after the other context has finished its execution you can also pass the original one as link parameter to the ctor of boost::context. with jump_to() you can yield and resume a context a linked context gets executed after the context to which it is linked ahs finished
There's no magic way to grab the context from which one came, or is there?
no - because it must not be necessarily the original context which will be executed next (could be an arbitrary context) ctx1 -> ctx2 -> ctx3 ^ | |______________| Oliver
participants (2)
-
Jeffrey Lee Hellrung, Jr.
-
Oliver Kowalke