Previous | Next --- Slide 17 of 66
Back to Lecture Thumbnails

Given that these animals can't eat each other, aren't these examples of starvation?



Both of them want to eat eat other but neither can make progress, so deadlock I think


In order to proof deadlock, you must have the 4 deadlock conditions.

2 Resources here I think: Frog's freedom + Goose's neck

  1. Mutual exclusion: Either the frog is free to leave or the goose tries to eat it. Either the goose has its neck unobstructed or the frog grabs it.

  2. Hold and Wait: Each one grabs each other's resource and refuse to let go.

  3. No pre-emption: It is not possible for one to steal that resource from another.

  4. Cyclic dependency: Goose cannot proceed until frog release goose's neck. Frog cannot proceed until goose stop eating the frog.


This is just too real and scary.