Operating Systems (6 cr), separate exam, 16.9.2014   suomeksiToisella puolella suomeksi  

Write in each answer sheet course name, date, your name, signature and student id.
For each question, it is sufficient to give a 1-2 page answer.
This is an ordinary separate exam and covers the whole course (6 cr).

  1. [9 p] Deadlocks
    1. [2 p] What is the deadlock problem? Give a concrete pseudocode example relating to Dining Philosophers Problem.
    2. [3 p] How do you prevent deadlocks with Bankers algorithm?
      (Note: no need to explain the algorithm itself, but only how it is utilized to prevent deadlocks.)
      Explain how your solution works with Dining Philosophers Problem. What advantages does this solution method have as compared to deadlock solutions based solely on deadlock detection? What disadvantages?
    3. [3 p] Deadlocks can be completely avoided by reserving resources in some given order? Why does this method work? Explain how this solution method would work with Dining Philosophers Problem. Why would this solution method (to avoid deadlocks) be better than using Bankers algorithm? What specific problems does this solution method cause?
       
  2. [9 p] Processor Scheduling
    1. [3 p] Which problem is solved with (short term, processor) scheduling algorithm? When does it work well? When does it work badly? What criteria is used to evaluate the goodness of the algorithm?
    2. [3 p] Mention three (3) different scheduling algorithms for uniprocessor environment and explain the main principles on how they work. For each algorithm, give an example situation where it would be better than the others.
    3. [3 p] How does multiprocessor scheduling differ from usual uniprocessor scheduling? Why are the uniprocessor scheduling algorithms not suitable in general for multiprocessor systems? Mention one scheduling algorithm specifically suitable for multiprocessor systems, and explain the main principles on how it works.

  3. [9 p] File Management Assume that disk contains 200 tracks. There are currently (in arrival order) the disk requests waiting for tracks 55, 58, 39, 18, 90, 160, 150, 38 and 184. The most recent request was serviced to track 100.
    1. [3 p] In which order are the queued disk requests serviced when disk scheduling algorithm is SCAN (elevator algorithm)? Assume here unrealistically, that no new disk requests arrive until these nine have been serviced.
    2. [3 p] What advantages does SCAN algorithm have as compared to FIFO and SSTF? What disadvantages?
    3. [3 p] Why does SCAN favor latest arriving new disk requests? How could one avoid that and quarantee fair service to old disk requests? Explain.

  4. [9 p] Memory Management
    1. [2 p] What problem is solved with replacement algorithm for paging virtual memory? When does it work well? What happens if it works badly? What criteria is used to evaluate the goodness of the algorithm?
    2. [2 p] How does replacement algorithm Clock operate? What hardware support does it need?
    3. [1 p] What problem is there with the basic Clock algorithm, and how can you work around it? Do you need more hardware support?
    4. [2 p] What problem is solved with resident set management algorithm? When does it work well? What happens if it works badly?
    5. [2 p] How does resident set management algorithm PFF (Page Fault Frequency) work? What environment is it suitable for? What hardware support does it need?
  5.