Two versions of this program are included. One is written in C and the other in CPP. Both make use of the pthreads library to start a new process that shares memory with it's parent. They both also use POSIX unnamed semaphores.
Both programs require several support files written in C:
msecond.c and msecond.h: Implements a function that returns the number of milliseconds (resolution is system dependent but is commonly 10 milliseconds) since it's first invocation.
random_int.c and random_int.h: Implements a function that returns a random integer from an exponetial distribution with a specified mean. There is also a function to initialize the random number generator. Used the standard library functions random() and srandom().
For the C version you need:
The source: philosopher.c.
The C version of the Makefile.
For the C++ version you need:
The source: philosopher.cc.
The C++ version of the Makefile.