Professional Documents
Culture Documents
========================
process thread
------- ------
fork -> pthread_create
wait -> pthread_join
exit -> pthread_exit (most often just "return")
The main function runs in a "main" thread. When the "main" thread is
over, all other threads (that are not detachable) stop as well,
regardless of whether they completed their work or not. So we need to
join the threads that we care to finish.