#include #include struct ctx { int id; }; static void work_fiber(void *ptr) { struct ctx *c = (struct ctx*) ptr; printf("Hello%d.1\n", c->id); tf_msleep(1); printf("Hello%d.2\n", c->id); } int main(int argc, char **argv) { struct ctx *c; int i; tf_vmach_start(); for (i = 0; i < 6; i++) { c = tf_fiber_create(work_fiber, sizeof(struct ctx)); c->id = i; tf_fiber_run(c); } tf_vmach_stop(); }