Dining Philosophers Problem
Published by admin, on Feb 15 2009, in the categories: Uncategorized
During this entire scene, the five philosophers don`t talk to each other. This situation can create a deadlock as they say meaning that every one of the philosophers has a felt fork and is waiting for a right one. The hole idea of the dining philosophers problem is that while they continuously wait for the right fork , they also get hungry. When one picks up the two forks or chopstick he starts eating. After a while he puts the chopsticks down and starts thinking. This is a tricky problems that makes people think. Because it`s played with philosophers it makes it more interesting. The most simple solution to this situation is bringing a waiter to assist them. The philosophers can ask the waiter when they can pick up the forks. If nobody else is using them, it`s alright, if not, they are not allowed to pick up the forks so that they can avoid deadlock. There is the possibility that 4 philosophers eat in the same time and one waits. He can only start eating after one of the four finishes. They all have to wait for the waiters permission.
The logic is quite simple and it makes the game continue smoothly. Each philosopher has his left fork and waits for the right one. This entire game is an analogy for computer problems. For example the lack of forks is the same thing as lacking of shared resources in real computer programming, also called concurrency. While locking a file or a resource a person makes sure that he is the only one that has access to it. When it`s already used by someone, the other person waits until the first one finishes. It`s a simple math problem than can be easily fixed. All the philosophers have to do is avoid deadlock and keep the game going.
If you liked this post, subscribe to our blog by filling your e-mail address below:
Want to add something? Post your comments
No comments on “Dining Philosophers Problem”
Wordpress Themes said on 06/13/2010:
Your comment is awaiting moderationNice fill someone in on and this post helped me alot in my college assignement. Thank you as your information.