If your design does not require you to syncronise at thread-end using
pthread_join to reclaim its resources, use the correct combinations of
pthread_attr_init, pthread_attr_destroy and pthread_attr_setdetachstate
to set each new thread to PTHREAD_CREATE_DETACHED before using
pthread_create. In this fashion using pthread_join is not allowed and
system-level thread specific resources assoicated the pthread_create
will be automatically reclaimed at thread-end.