Week 8

Monitors

  • Marc's Lecture Notes: PDF
  • Ben-Ari Ch 7
    • begin slide 146
  • Dr. Seuss on Deadlock:
  • Class participation with monitors: (unfinished business)
    • The One-Lane Bridge problem:
      Cars coming from the north and south arrive at a 
      one-lane bridge. Cars heading in the same direction 
      can cross the bridge at the same time, but cars 
      heading in opposite directions cannot.
    • can we find a way to be safe, fair, and efficient?
    • PDF (with thanks to Charlie Hughes!)
    • updated with a missing example
  • Java case study (starter code for Assign 4)
    • this version deadlocks!
    • you will use two different approaches to fix:
      • synchronized methods
      • synchronized code blocks

  • Assign 4
    • due: Wed, Nov 2, 11:59pm