Homework 10

22C:116, Spring 1995

Due Friday Apr. 21, 1995, in class.

Douglas W. Jones
  1. Background: In section 4 (composite Thread Systems) of the lecture notes for April 14, , an implementation of a thread-safe semaphore is given in terms of a nonblocking kernel semaphore and some extra code. This allows a thread to block on a semaphore implemented by the kernel without blocking the underlying support process that was running the thread at the time it blocked.

    The Problem: Solving this problem for input/output is somewhat more difficult. Consider the UNIX read() operation (in part 2 of the UNIX programmer's reference manual). Can you propose a nonblocking alternative to read() and a corresponding thread-level read operation that blocks the thread without blocking the underlying support process.

  2. Background: In a multiprocessor system with user-level threads, processes and shared memory, it is common to find each mutual exclusion and synchronization mechanism offered in three forms, one that uses busy waiting, one that is implemented by the thread package, and one that involves a kernel call.

    The Problem: Why are all three alternatives typically provided, and how would you decide which one to use in any particular application?

  3. Background: There are three fairly obvious ways to use a network of workstations:

    First, each workstation can be dedicated as a personal workstation for the use of an individual user.

    Second, the workstations can be viewed as a single computational resource, logically a single shared computer system with a number of displays and a number of disks scattered around it.

    Third, machines may be specialized. Some may serve as file servers, some as terminal servers, for example, X-terminals, and some as a pool of compute servers.

    Problem, part A: Given a fixed application mix on the part of the users, which of these is likely to place the greatest demands on the bandwidth of the network.

    Problem, part B: What load balancing problems does each of these alternatives pose? Which resources are involved and what objects need to be moved in order to balance the load?