Comp111 -- Midterm Exam Review 1

Midterm Exam Mon Nov 6, 2006 - open book and notes

Midterm topics

All review questions in the book are fair game, as well as questions similar to assigned or auxiliary problems. The exam is open book and notes.

  1. Explain exactly why monitors are preferable to semaphores, with examples.
  2. Compare overhead of the banker's algorithm with overhead of deadlock detection and kill. In which situations is each superior?
  3. Consider the following resource allocation graph. Is the system deadlocked? If so, which processes are involved?

  4. Suppose for the banker's algorithm described in class, we have the following scheme:
     
                requested     allocated 
                r1 r2 r3 r4   r1 r2 r3 r4 
    process 1   2  5  3  2    1  0  3  2 
    process 2   1  5  1  1    1  1  0  0
    process 3   3  3  3  3    3  3  3  3
    
    and suppose that the total of available resources is
     
    r1 r2 r3 r4
    12 12 7  9
    
    Is this a safe state? Why or why not?
  5. What is the impact upon deadlock if one forces a set of otherwise unconstrained processes to allocate one resource unit at a time, even if they need a large number of resource units?