Using ANSI C, implement controls to ensure deadlock avoidance in the dining philosophers problem described in section 7.5.3. I have provided a test harness that takes care of the threading and detects if two adjacent philosophers are attempting to eat simultaneously. You may use them if you wish.
Download the three files and implement your solution by modifying
the philosopher.c file. Your solution should ensure that
no two philosophers ever deadlock or are eating at the same time.
Turn in a printout of your solution (i.e. philosopher.c)
and place a copy online where I may retrieve it to compile and test.
Do not forget to comment your code and use meaningful identifiers.