Quiz 2 -- The Dead Locked Quiz


1) When is busy waiting (spin locking) better than the alternative?  When is it worse?
 
 
 
 
 
 

2) Suppose some operating system architect numbers the devices in order tape > disk > printer > cdrom.  Normal processes cannot request devices except in order.  However, each process can decide if it wants to go low -> high or high -> low.  Does this prevent deadlock?  If so, why?  If not, give an example of a deadlock.
 
 
 
 
 

3) To guarantee that a process is the only one accessing a data structure, it could just turn off interrupts.  Give one advantage of this scheme (beyond it works), and one disadvantage.
 
 
 
 
 

4) Must access to the ready queue be guarded by locks, semaphores, or critical sections?   Must access to the private data of a process be guarded similarly?