Creating threads
Always include pthread library:
int pthread_create (pthread_t *threadp, const pthread_attr_t * attr, void *(* start routine)(void *), void *arg);
This creates a new thread of control that calls the function start_routine.
It return a zero if the creation is successful, and thread id in threadp (first parameter).
attr is to modify the attributes of the new thread. If it is NULL default attributes are used.
The arg is passing arguments to the thread function.