Calendar‎ > ‎

Synchronization Q&A

  1. Go over the Synchronization slides, starting from Slide 23. 
  2. Make sure test-and-set is clear. We are trying to wait until the lock->held goes to zero AND set it to 1 atomically.
  3. Let's go over the implementation of spin locks in os161, find the place where test-and-set instruction is invoked. 
  4. Test-and-test-and-set: what is the point? Why is this better than test-and-set? Slides.
  5. Blocking vs spinning
    1. When can spinning be bad? 
    2. When can spinning be good? 
    3. Go over the scheduling example to illustrate blocking vs spinning: unicore vs multicore. Slides.
    4. Explain the context switch overhead
  6. Disabling interrupts
    1. Why wouldn't this work on a multiprocessor? 
    2. Why does os161 mutex implementation uses atomic instructions AND disables interrupts?
  7. Let's go over the semaphore implementation of semaphores in os161. Any questions? 
  8. How are locks different from semaphores?