CSE 120 Spring 2002 Homework 1
Due 11 April 2002
Problem 1
Some simple machine organization questions:
-
Briefly describe the differences between traps
and interrupts.
-
Many architectures rank interrupts in terms of priorities.
What do these priorites represent? Why is this a useful thing to do?
Problem 2
Consider the following proposed solution of the mutual exclusion problem.
int in0 = 0, in1 = 0;
cobegin
while (1) {
in0 = 1;
while (in1) {
in0 = 0;
while (in1) ;
in0 = 1;
}
critical section
in0 = 0;
}
||
while (1) {
in1 = 1;
while (in0) {
in1 = 0;
while (in0) ;
in1 = 1;
}
critical section
in1 = 0;
}
coend
-
Does the solution satisfy the safety property of the mutual exclusion
problem? If so, then give an informal argument saying why. If not, then
give an adversary schedule that violates safety.
-
Does the solution satisfy the liveness property of the mutual
exclusion problem? If so, then give an informal argument saying why. If
not, then give an adversary schedule that violates liveness.
Problem 3
Consider an elevator, such as one of those in AP&M.
-
Define a state of this system as a set of variables.
-
Give two safety properties of this system.
-
Give two liveness properties of this system.
last edited 1 April 2002 by kam