CS 110 Homework Assignment 2
Due: Sunday, February 24, 9PM

The material for the questions below can be found in any operating system text.
Remember, no hand written material. Use a text processor - you might try troff or latex/xfig.
Also remember to date and time stamp your homework.

  1. Points 3, T.2.5, pg 71.
    Consider a computer that does not have a Test & Set Lock instruction, but does have an instruction to swap the contents of a register and a memory word in a single indivisible action. Can that be used to write a routine enter_region such as the one discussed in class.
  2. Points 3, T.2.20, pg 72,
    Measurements of a certain system have shown that the average process runs for a time T before blocking on i/o. A process switch requires a time S, which is effectively wasted (overhead). For round robin scheduling with quantum Q, give a formula for the CPU efficiency for each of the following:
    • Q = infinity
    • Q > T
    • S < Q < T
    • Q = S
    • Q nearly 0
    Note: CPU efficiency = useful CPU time / total CPU time
  3. Points 3, gen.3
    A soft real-time system has four periodic events with periods of 50, 100, 200, and 250 msec each. Suppose that the four events required 35, 20, 10, and X msec of CPU time, respectively. What is the largest value of X for which the system is schedulable.
  4. Points 3, T.2.23, pg 72,
    Five jobs are waiting to be run. Their expected run timers are 9, 6, 3, 5, and X. In what order should they be run to minimize average response time? (Your answer will depend on X).
  5. Points 5, s.5.4, pg. 151
  6. Points 5 s.5.5, pg. 151
    Consider a variant of the RR scheduling algorithm where the entries in the ready queue are pointers to the PDBs.
    1. What would be the effect of putting two pointers to the same process in the ready queue?
    2. What would be the major advantages and disadvantages of this scheme?
    3. How would you modify the basic RR algorithm to achieve the same effect without the duplicate pointers?
  7. Points 3, s.5.9, pg 152
    Suppose that a scheduling algorithm (at least of short-term CPU scheduling) favors those processes that have used the least processor time in the recent past. Why will this algorithm favor I/O bound programs and yet not permanently starve CPU-bound programs?
  8. Points 5,
    Get on turing. Run ps and determine:
    1. the parent process owned by you for your session.
    2. the parent process of the system for which your parent process is a child
    3. the longest chain of parent/children processes for your session.
    4. the scheduling priority of your processes.

    Turn in an anotated script file of your ps answering the questions above.
  9. Points 5,
    What is the "Configured TS (Time Sharing) User Priority Range" on turing start with the nice command and go looking

Last modified Jan 31, 2001 by mike@cs.hmc.edu