Week 4

Critical Sections

  • Recap from last week:
    • UPC setup, including ssh keys and script to compile/run
    • Finish up demo of last two versions of UPC temperature programs
    • vim questions? tips/advice?
    • Programming assignment 2 due: next Tue, Feb 17
  • Ben-Ari Ch 3
    • slides: PDF
      • begin slide 3.1, p. 50
    • The approaches to enter and exit critical sections were low-level and brittle
      • low-level because: relied on busy-waiting and checking on global variables
      • brittle because: many reasons!
        • processes relied on each other to enter their own CS!
        • hard-coded for a specific number of processes (i.e., 2)! what about for n?

Class Exercise

Semaphores

  • Next we introduce the abstraction of semaphores to control access to CS
  • Ben-Ari Ch 6
    • slides: PDF
      • begin slide 6.1, p. 111
  • Written HW: Ben-Ari p. 39:
    • Exercises 2, 3, and 4
    • Haven't forgotten that I owe you feedback–sorry!
  • UPC Exercises 1.1 through 1.7
  • Due: Tue, Feb 17, 11:59pm
  • Here's a link: private