
Am 19.01.2011 12:40, schrieb Andrzej Krzemienski:
Which somehow implied that Context is lower-level than Coroutine or Fiber. If you really treat Context the same level as Thread, I would suggest passing function<void()> as trampoline function. If you can afford using pimpl, you can easily change function<void()> to void(*)(void*) and void* parameters:
void call( void* arg) { auto ptr = static_cast< function<void()>*>( arg ); ptr->operator(); }
function<void()> trampoline = ...; context_impl( call,&trampoline );
Using function<void()> makes it easier to understand for thread users and makes the interface similar to thread, task, etc...
It make the implementation in assembler much more complicated (call C++ conventions in assembler). so long, Oliver