The dining philosophers problem, an introduction to pthreads.