Consider EP = LP // ST. The booleans are global to LP and ST. Does EP terminate?
b := true; LP:: do b --> skip od ST:: b := false |
b := true; t := false; LP:: do b --> t := true; t := false od ST:: < await t --> b := false > |
It is not "possible" to devise a scheduling policy so that
Dinining Philosophers Problem illustrates Deadlocks, Livelocks, and Starvation well.
If each philosopher picks up their left fork and won't let go off it until he finishes eating, we have a deadlock.
If each philosopher picks up their left fork and being very considerate give it up when he cannot get hold of the right fork, we have a livelock if each one of them does this synchronously.
Both deadlocks and livelocks cause starvation. But there are other ways of causing it.
2012 pmateti@wright.edu