UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department | ||
CS 537
Spring 2000 | A. Arpaci-Dusseau | |
Quiz #4: Wednesday, March 8 |
Name: | Student ID #: |
a) Consider the resource-allocation graph shown above. Show a sequence of lock.acquire() instructions performed by processes P1, P2, and P3 for locks R1, R2, and R3 that would lead to the state depicted in the resource-allocation graph. If there is more than one possible ordering for two or more acquire instructions, then do not place any artificial contraints on their ordering (i.e. show those instructions could run in a different order by placing them on the same line).
b) Assume that these resources require mutual exclusion, that each process holds onto its current resource until it can acquire the next resource, and that resources cannot be preempted. Does deadlock exist in this system depicted by the resource-allocation graph? If not, explain why not. If so, list all possible processes that could be killed to remove the deadlock.
b) Assume that job A is running on the CPU. Describe two circumstances in which a SJF scheduler will keep job A running, but a STCF scheduler will pick a different job.