I picked up the following demo off the web from https://computing.llnl.gov/tutorials/pthreads/
#include #include #define NU
You need to use the option -lpthread with gcc.
-lpthread
Compile it like this : gcc demo.c -o demo -pthread