This is too big a task for us to explain what this whole code does, how and why. The only thing that can be briefly said is that it is a threaded solution to the
Dining philosophers problem[
^].
What you can do to understand what it does, how and in which order, is to put a breakpoint on the first line of the
main()
method, start a debug session, and then execute it line-by-line; by doing this, you will be able to follow the execution flow.
If you can refine your question and specify which line exactly you are having trouble to understand, then we could be more specific.