The dining philosopher problem is a classic problem in deadlock management. Theproblem can be described briefly as follows. There is a round table around which atotal of five philosophers are sitting. There are also a total of five plates in front of thephilosophers and five forks, one each beside each plate. A philosopher can only eat ifs/he can get two forks lying beside the plate. The philosophers do not have any meansof communicating with each other to control access to their forks. A situation wherenone of the philosophers is able to eat because they are all able to access a single fork(but not both) is called deadlock. The goal is to design a protocol of choosing theforks among the dining philosophers so that no deadlock occurs.
Now assume that the philosophers need both the forks to eat AND the saucebowls to eat. Write another program to implement the deadlock-free solutionof this version of the problem.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here