
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