PTHREADS is a directory of C++ programs which illustrate the use of the POSIX thread libraries for parallel programming.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
PTHREADS is available in a C version and a C++ version.
MPI, C programs which illustrate the use of the MPI parallel programming interface for distributed memory systems.
OPENMP, C programs which illustrate the use of the OpenMP application program interface for carrying out parallel computatioins in a shared memory environment.
DOT_PRODUCT is an extensive example which shows how the dot product of two vectors could be computed.
You can go up one level to the C++ source codes.