Solution

HOME RESEARCH MY TRIP MY MENTOR ABOUT ME FINAL PAPER

Solution

The picture below shows Edsger Dijkstra (a Dutch computer scientist) who solved this famous concurrency problem.

First solution: Each philosopher will grab the fork on their left and then the fork on their right. - This solution does not work quite well because it ends with a deadlock (when the philosophers grab a fork on one side, but then left waiting to grab the fork on the other side forever)

Real solution: Between philosophers 0-4, one of the philosophers will grabs the forks in a different order than the others. Therefore, no philosopher will encounter a deadlock because one of them will grab the fork to their right before grabbing the fork to their left.

Copyright 2015. Michelle Tocora. All rights reserved.