pthreadcreate
pthread_create is a function provided by the POSIX Threads (pthreads) library, used to create a new thread of execution in a program. The function is declared in the header <pthread.h> and has the following prototype: pthread_create(pthread_t thread, const pthread_attr_t attr, void (start_routine)(void ), void arg). When called, the operating system creates a new thread, assigns it a unique thread identifier stored in thread, and begins execution at the function pointed to by start_routine. The start_routine function receives a single argument arg and typically returns a void pointer that can be retrieved via pthread_join.
The attr parameter allows specification of thread attributes such as stack size, scheduling policy, and detach
pthread_create returns 0 on success. On failure, it returns an error number and the thread is not
In practice, a program might spawn several worker threads with pthread_create, each performing a portion of