Introduction - If you have any usage issues, please Google them yourself
The Case Study of deadlock, the Dining Philosophers, here are five different implementations (as in the study of this issue in the previous made a lot of ideas), where realization of the most common of the five classic