CEG 7370: Distributed Computing Principles

Fairness, Deadlocks, Livelocks, and Starvation

Prabhaker Mateti


Fairness

Fairness deals with "scheduling". It is a "system" property, not that of a (collection) of process(es). You cannot deduce it from the text of the code of the processes.

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

  1. it is practical, and
  2. strongly fair

Deadlocks

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.

Livelocks

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.

Starvation

Both deadlocks and livelocks cause starvation. But there are other ways of causing it.


Copyright © 2012 pmateti@wright.edu