CSE 120 Spring 2002 Homework 1

Due 11 April 2002

Problem 1

Some simple machine organization questions:
  1. Briefly describe the differences between traps and interrupts.

  2. 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
  1. 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.

  2. 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.
  1. Define a state of this system as a set of variables.

  2. Give two safety properties of this system.

  3. Give two liveness properties of this system.

last edited 1 April 2002 by kam