Yliopiston etusivulle Suomeksi På svenska In English
Helsingin yliopisto Tietojenkäsittelytieteen laitos
 

Tietojenkäsittelytieteen laitos

Suomeksi In English Homework

Concurrent Programming, Autumn 2007, HW 5

These will be covered in practise session during the week 48, 26-31.11.2007.
  1. Exercise 6.6 from text book.
     
  2. Look at the Algorithm 6.21 in text book (p. 144). Notice the typo in algorithm.
    1. Show that readers have priority over writers.
    2. Will the algorithm work, if all three semaphores would be busy-wait semaphores instead of the usual suspend-wait semaphores? Under which conditions one should/should not use busy-wait semaphores instead of the usual suspend-wait semaphores?
    3. Modify the algorithm so that writers have priority over readers. Why would one want to do it this way?
    4. Modify the algorithm so that readers and writers have same priority. Why would one want to do it this way?

     
  3. Redo problem 1 in homework set 4 (BACI PlusMinus program) with monitor.

  4.  
  5. Look at the Algorithm 7.3 in text book (p. 152). Notice the typo in algorithm.
    1. What significant differences does algorithm 7.3 have when compared to the multiple producers/consumers solution given in lectures (lecture 6, slide 16; Andrews, Fig 4.5)? Which one is better/worse and why?
    2. What does the concept monitor signalling semantics mean?
    3. Algorithm 7.3 is based on IRR signaling semantics. Give a scenario where the algortihm does not work properly if signalling semantics E=S=W were be used.
    4. How should one modify the algorithm 7.3 for E=S=W monitor signalling semantics?

     
  6. Redo problem 4 in homework set 4 (narrow bridge) with semaphores so that waiting cars will wait in private semaphores.

  7.  
  8. Redo problem 4 in homework set 4 (narrow bridge) with monitor.


Teemu Kerola 16.11.2007 12:43