This document contains simple examples of basic elements that are combined to form patterns often used in programs employing parallelism. The examples are separated between two major coordination patterns:
- message passing used on single multiprocessor machines or clusters of distributed computers, and
- mutual exclusion between threads executing concurrently on a single shared memory system.
Both sets of examples are illustrated with the C programming language, using standard popular available libraries. The message passing example uses a C library called MPI (Message Passing Interface). The mutual Exclusion/shared memory examples use the OpenMP library.