Unix IPC primitives

POSIX support for monitors

Standard POSIX, IEEE 1003.1c, defines a programming interface (API) for the creation and synchronization of threads.

  • In unix, this interface is implemented by the pthread library.

It allows for the implementation of monitors in C/C++.

  • Using mutexes and condition variables.

  • Note that they are of the Lampson / Redell type.

Some of the available functions:

  • pthread_create - creates a new thread, similar to fork.

  • pthread_exit - equivalent to exit.

  • pthread_join - equivalent to waitpid.

  • pthread_self - equivalent to getpid().

  • pthread_mutex_* - manipulation of mutexes.

  • pthread_cond_* - manipulation of condition variables.

  • pthread_once - initialization.

Last updated