Thread Creation/Termination (Cont.) The 'main' function created a new thread using 'pthread_create'. The new thread will execute the 'thread_func' function. the 'pthread_create' function returns immediately after the thread is created. Since context switching between the old thread (running 'main') and the new thread (running 'thread_func') is arbitrary - we are not guaranteed which thread will continue first. We added the 'sleep' call to give the new thread a chance to run before 'main' exits - which causes the whole process (including all its threads) to terminate.