Joining Threads, This example http://siber.cankaya.edu.tr/ozdogan/ParallelComputing/cfiles/code45.c program demonstrates how to ``wait'' for thread completions by using the Pthread join routine. Since some implementations of Pthreads may not create threads in a joinable state, the threads in this example are explicitly created in a joinable state so that they can be joined later. Compile as
gcc -o code45 code45.c -lpthread -lm