Multithreaded programming

This section provides guidelines for writing multithreaded programs using the threads library (libpthreads.a).

The AIX® threads library is based on the X/Open Portability Guide Issue 5 standard. For this reason, the following information presents the threads library as the AIX implementation of the XPG5 standard.

Parallel programming uses the benefits of multiprocessor systems, while maintaining a full binary compatibility with existing uniprocessor systems. The parallel programming facilities are based on the concept of threads.

The advantages of using parallel programming instead of serial programming techniques are as follows:
  • Parallel programming can improve the performance of a program.
  • Some common software models are well-suited to parallel-programming techniques.

Traditionally, multiple single-threaded processes have been used to achieve parallelism, but some programs can benefit from a finer level of parallelism. Multithreaded processes offer parallelism within a process and share many of the concepts involved in programming multiple single-threaded processes.

The following information introduces threads and the associated programming facilities. It also discusses general topics concerning parallel programming:

Note: In this topic collection, the word thread used alone refers to user threads. This also applies to user-mode environment programming references, but not to topics related to kernel programming.