Dining-Philosophers Problem C (Linux)

Job ID: 32088123

Budget: $50 – $60 USD

N philosophers spend their lives thinking and eating.
They share a common circular table surrounded by N chairs, each belonging to one philosopher.
In the center of the table, there is a bowl of rice, and the table is laid with N single chopsticks.
If a philosopher is not eating, he is thinking, and if he feels hungry he must pick up the two chopsticks that are closest to him one at a time. He can only eat if he has two chopsticks.
After eating he must put down his After eating he must put down his chopsticks and start thinking again.
How can we model the behavior of each philosopher such that we provide maximum overlap of eating philosophers and id avoid: Deadlock, Indefinite waiting?
Solve the above problem by writing a multi-threaded C using synchronization tools (Event counts, Locks, Condition variables, and/or Monitors) except Semaphores to solve a typical synchronization problem. Such that the solution satisfies all the following three conditions:
• Maximum number of concurrent philosophers can eat at the same time.
• No possibility of deadlock.
• No possibility of starvation.
The program must allow the user to specify the number of philosophers, N, as a command line parameter. Also, it must use the following files to generate its graphical output:
a. DiningTable.o library of functions you need to include in the program for graphical output.
b. DiningTable.h contains declarations and documentation of all functions in the above library.
c. Rice.bmp the image of a bowl of rice to be drawn on the dining table.
The program must call function init(N) at its start, and must call function finish() before it exits. Each philosopher goes through the following states: thinking, hungry, and eating, repeatedly, in an endless loop. In the loop, a philosopher shall have random time delays simulating the times he spends eating and thinking. Since you are using an endless loop, the program shall respond to a ctrl-c signal by ending the loop, cleaning up, and exiting.
All requirements are in the attached file
deadline in two days