Threads vs. Processes

Thread Mapping

Modern systems expose multiple layers between the bare CPU and your application’s threads:

Pthreads (POSIX Threads)

Include the header: #include <pthread.h>

1. Creating & Exiting

int pthread_create(pthread_t *thread,
                   const pthread_attr_t *attr,
                   void *(*start_routine)(void *),
                   void *arg);