Generators for C++, using ucontext to switch context