Homework 12

22C:116, Fall 1998

Due Monday Nov 30, 1998, in class

Douglas W. Jones
  1. Background In hierarchical software system designs, software in higher levels of the software system usually operates on the lower layers by calling lower level procedures, functions, or methods of lower level objects. So, the usual system structure organizes each layer as a library of procedures, functions and classes that may be used by higher layers.

    In hierarchical software system designs, the term callback is used to refer to cases where lower levels call procedures or functions in higher levels.

    Part A: Give an example of a callback in the context of the UNIX operating system.

    Part B: Discuss the relationship between callbacks and interrupts.

    Part C: In the discussion of kernel support for user-level threads, one option suggested was to replace kernel services that would normally block with nonblocking variants that use a callback to signal that the operation is complete. Thus, for example, we replace the blocking UNIX kernel service write(f,buf,len) with a new service nbwrite(f,buf,len,cb). This new service calls the callback cb as soon as the write completes.

    Consider our example thread package. Write code for thwrite(f,buf,len) that behaves as a blocking write operation, but blocks only the calling thread instead of blocking all of the threads in the user process. You may assume that there is always some other ready thread if this simplifies your design.

  2. What possibilities does a distributed file system offer that are not possible in a distributed system with one or more a file servers.

  3. In the DEMOS MP process migration scheme, forwarding addresses tended to accumulate over time. In class, it was suggested that one solution to this is to delete forwarding addresses T time units after they are created, and to require that the name-server be informed of the location of each process within T time units of that process's move to a new location.

    Part A: In the context of DEMOS MP, who are the clients for this name server?

    Part B: Access to a name-server can become a bottleneck as a system grows. Discuss the effect of changing the value of T on this problem.