thrd_create is the C11 <threads.h> function for creating and starting a thread. It receives a pointer to a thrd_t object, a thrd_start_t function pointer, and a void* argument passed to the new thread's start routine. The routine returns int; returning from it terminates the thread. section 20.0
Starting four game threads
A program can store thread identifiers in an array and start four routines that share the same game-state object: thrd_create(&thrd[0], update_thread, &L); thrd_create(&thrd[1], draw_thread, &L); thrd_create(&thrd[2], input_thread, &L); thrd_create(&thrd[3], account_thread, &L); Each routine receives the void* argument, converts it to a life* pointer, and performs its task concurrently with main and the other threads.
