Week 6

Homework

  • UPC exercises 1.1 — 1.7
    • Assigned: 2/18
    • Due: 2/27

Exam Reminder

  • Exam next Wednesday, March 6
  • handout: sample questions from a previous exam
  • Review session next Monday, March 4

Lecture Notes

Semaphores

  • Two operations:
    • wait(s)
      • Traditional: P(s)
      • Definition:
         < await (s > 0) s = s - 1; >

    • signal(s)
      • Traditional: V(s)
      • Definition:

         < s = s + 1; >

  • wait(s) and signal(s) work the same for binary and counting (general) semaphores
    • binary semaphore: value is always either 1 or 0
    • general semaphore: value is nonnegative

Class exercise

  • The Bear and the Honeybees (handout)
    • split binary semaphores
    • technique: pass the baton
  • The Water Molecule Problem (handout)
    • solve using counting semaphores
    • solve using a single mutex

Semaphores

  • Ben-Ari Ch 6
    • slides: PDF
      • begin slide 105
courses/cs377-201301/week6.txt · Last modified: 2013/02/27 17:58 by mlsmith
VCCS Top Events Extended Site Search Login Vassar Science Web Vassar Home Driven by DokuWiki Valid XHTML 1.0