#include #include struct ctx { int timeout; }; static void work_fiber(void *ptr) { //struct ctx *c = (struct ctx*) ptr; tf_msleep(rand() % 5000); tf_msleep(rand() % 5000); tf_msleep(rand() % 5000); } static void init_fiber(void *ptr) { struct ctx *c; int i; for (i = 0; i < 1000; i++) { c = tf_fiber_create(work_fiber, sizeof(struct ctx)); tf_fiber_put(c); } } int main(int argc, char **argv) { return tf_main(init_fiber); }