Pthreads - POSIX standard threads

Pthreads - POSIX standard threads

This page is only a rudimentary outline of ideas and basic functions for Pthreads.
  1. Basics
    1. Threads versus processes: When to use threads.
    2. Creating, joining, and killing pthreads (but not cancel!).
      1. pthread_create()
      2. pthread_join()
      3. pthread_exit()
    3. Thread identification.
      1. pthread_t handles
      2. pthread_self()
      3. pthread_equal()
    4. File locking.
      1. flockfile
      2. ftrylockfile
      3. funlockfile
  2. Interthread sychronization and communication
    1. Mutex variables.
      1. pthread_mutex_t data type
      2. pthread_mutex_init() and use of pthread_once().
      3. pthread_mutex_lock(), pthread_mutex_unlock(), pthread_mutex_trylock()
      4. priority inversion problems.
    2. Scheduling
      1. scheduling scope
      2. policies: SCHED_FIFO, SCHED_RR, SCHED_OTHER
      3. mutex-based scheduling: PTHREAD_PRIO_PROTECT, PTHREAD_PRIO_INHERIT.
    3. Condition variables.
      1. pthread_cond_t data type
      2. static and dynamic initialization of condition variables
      3. pthread_cond_signal() and pthread_cond_wait()
      4. pthread_cond_timedwait(), pthread_cond_broadcast()
    4. Building common synchronization systems.
  3. Thread system models
    1. Master/slave systems.
    2. Peer thread systems.
    3. Producer/consumer systems.
    4. Pool of threads systems.
  4. Advanced pthreads
    1. Keys and thread private copies of shared data.
    2. Thread attributes.
      1. detached pthreads
      2. stack size
    3. Cancellation of pthreads.
      1. disabling cancellation
      2. deferred and asynchronous cancellation
      3. cleanup stack.
    4. Vendor implementations of pthreads.
      1. Kernel, user, and two-level threads.
      2. SGI sprocs.
    5. Interaction between threads and processes: signal handling, fork() and exec(), pthread_atfork