Homework 10

22C:116, Spring 1999

Due Friday Apr 16, 1999, in class

Douglas W. Jones
  1. Background: Assume a basic thread package containing primitives for thread creation, thread synchronization, and thread control. Assume this thread package is implemented in a typical operating system environment, with a complete suite of file and (heavyweight) process management tools.

    Nowhere in the manuals for this system does it say whether the thread package is a user-level library or part of the system kernel. The system is such that kernel calls and library calls are indistinguishable at the level of source code, and the object code is hidden from inspection.

    Problem: What experiments could you do to determine whether the thread package was a user or kernel package, and how would you interpret the results of these experiments.

  2. Background: Consider the problem of designing a multi-user system. There are at least three ways of designing such a system from a collection of equally powerful CPUs:

    Part a: Each of the above alternatives works best under different patterns of use. Clearly identify what quantifyable aspects of the applications are relevent to the question of what system configuration is best.

    Part b: In terms of the quantifiable variables you identified in part a, what kinds of applications will work best in each of the above system configurations, assuming that each configuration has exactly the same number of CPUs.

  3. Problem: Explain the difference between supply driven load balancing and demand driven load balancing. (As in economics, supply and demand refer to resources.)

  4. Background: UNIX contains kernel services that allow non-blocking I/O. In the context of keyboard input, for example, there are ways to ask the system to return to you either an indication that no key was pressed on the keyboard, or the character code for the key that was pressed. Most versions of UNIX support several ways of doing this.

    Part a: Using the tools available to you (library books, on-line help systems, the web), find a way of doing this.

    Part b: Why are such mechanisms important to implementors of user-level thread packages?