[Solved] SOLVED: Diningphilosophers.java

$25

File Name: SOLVED:_Diningphilosophers.java.zip
File Size: 292.02 KB

SKU: [Solved] SOLVED: Diningphilosophers.java Category: Tag:
5/5 - (1 vote)

1.The dining philosopher problem consists of five philosophers that spend their entire life either thinking or eating. There are five states that a philosopher can be in. These are thinking, eating, hungry, famished, or starved. After a random time period of thinking, a philosopher will try to pick up two chopsticks (on the right and left of him). If he succeeds, he goes into the eating state. If he fails (because other philosophers have one (or both) of the chopsticks), he waits and then tries again. After a certain number of waits and unsuccessful tries (your choice of how many), he switches to the hungry state. If he waits and unsuccessfully tries a number of more times, he switches to the famished state. Finally, if he still cannot get a pair of chopsticks, hell die and go to the starve state. After eating, a philosopher releases the two chopsticks and goes back to thinking. The philosophers are greedy; they will never release a chopstick that they pick up if they are waiting to eat.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED: Diningphilosophers.java
$25