Create thread_gen.c