The following program demonstrates the use of pthread_create to spawn a thread and pthread_join to join with the thread once it terminates and retrieve its return value. The thread itself simply computes the length of the input string.
The source code and Makefile are available as a zip file.
To run program, simply enter:
./simple_thread