MCS-378 Homework 2, Fall 1999

Due: October 1, 1999

  1. Windows NT Workstation versions 3.x and 4.0 both provide some scheduling preference for the user's "foreground" application - the application with the window that is currently "in focus" (i.e., the window that would receive any keyboard input from the user). However, the nature of this scheduling preference was changed in NT 4.0 versus 3.x. As background information, I'll summarize the scheduling algorithm used in both versions of NT. (This description is simplified, but gives the essential features.) The basic scheduling algorithm is a preemptive multilevel queue, with one queue for each priority level and round-robining among the processes at any one priority level. Under normal circumstances, all a user's processes will be at the same priority level (8, as it happens) and will use the same time quantum for round-robining (normally 30 milliseconds). Of course, a process may not run for its full time quantum - it can be preempted by an arriving higher-priority process, in which case it will get the remainder of its quantum when it resumes, or it can go into a waiting state before the quantum is up, in which case it gets a fresh quantum when it again becomes ready to run. With this information as background, here is the difference between NT 3.x and 4.0: in 3.x, the foreground application gets boosted to a higher priority level, whereas in 4.0 it instead gets double the normal time quantum. (In 3.x it keeps the normal quantum and in 4.0 it keeps the normal priority.) Explain what you would expect the user-visible results of this difference to be, and why. How would the foreground application behave differently? How would other (background) applications behave differently?

    1. Explain why the notifyAll in Figure 7.36, page 214, can be safely changed to notify.

    2. Explain how the code in Figure 7.36, page 214, can be changed to do fewer notifyAll (or notify) operations.

    3. Explain how the code in Figures 7.35-7.37, pages 213-215, can be changed to eliminate the dbReading instance variable.

  2. Do exercise 8.8 from page 249. (If this isn't challenging enough for you, you can do exercise 8.9 instead.)


Instructor: Max Hailperin