Subscribe

Powered By

Powered by Blogger

Friday, April 24, 2009

Dining Philosopher's Problem

 

I am finally done with my system software and operating system orals .They were good and i’m expecting a good score. Although studying for 2 nights in a row without sleep was tiring i did come across one of the funniest illustration of my life.

 

Deadlock – A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function.

 

To understand this here is the most hilarious example of the century .

 

During olden ages there used to 5 witty philosophers whose only aim in life were to think and eat . Now one fine day they realised that they should eat spaghetti to increase their brains because spaghetti has proteins. Since  these philosophers were rich filthy bastards with loads of table manners and shit ( who knows maybe they were British :P ) they were trained to eat with two forks only and they had to start by picking the fork with the left hand first . And without 2 forks they would not eat .

 

* I swear im not drunk , this is true !!!! . Google it :P *

 

So they proceed towards a dining hall with 5 bowls of spaghetti and 5 forks present. Each of them grabs a fork with the left hand and realises that there are no more left. Thus a deadlock occurs :P

 

*hhahahaahahahahahahahaahahahah ok i cant control laughing but its true !!! *

 

Solution : Keep a guard to allow only 4 people at a time so one fork is free to use. Now 3 people can stare while one finishes off his food . Thus although there is starvation for a while but everyone does get to eat in the end.

 

Or they could buy a new fork  or maybe turn Indian and start eating without forks Lol .

 

 

------------------------ ABOVE is what the reference book says ---------------------------------

 

 

I find a major flaw in this logic .

 

1) If the philosophers are filthy rich bastards who refuse to eat without 2 forks . Why would they prefer a used fork after the first guy is done eating !

 

2) What if the guard is hungry too ?? Then making the 5th person stay outside is pointless.

 

 

Solution – Think Indian again . Get a maid who will clean the forks after use and since she doesn't have table manners like the pathetic rick freaks … she could just do eating with bare hands in case she gets hungry .

 

 

O_o thanks taurius1 for giving the idea to put in on a blog .. i know u were gonna do it .. but i coudnt resist !!!!  Credits to this man too  THE MAN

 

0 comments: