Pthreads is a standard interface for creating and managing threads on Unix operating systems. In particular, it is a set of C language types and functions that have a well-defined behavior.

The P in Pthreads stands for "POSIX", the set of standards that most Unix operating systems adhere to. Pthreads are defined in IEEE POSIX 1003.1c-1995. A popular superset of the standard is defined in CAE Specification System Interfaces & Headers Issue 5 (XSH5) of the Single UNIX Specification, Version 2.

The library itself provides three major areas of functionality:

  • Creating, managing, running, and deleting threads:
    pthread_create, pthread_exit, pthread_join, ...
  • Synchronizing threads with mutexes and condition variables:
    pthread_mutex_lock, pthread_mutex_unlock, pthread_cond_wait, ...
  • Managing thread specific data:
    pthread_setspecific, pthread_getspecific, ...