Reading Assignment and Discussion Topics
Computer Science 111

for class on Tuesday March 21, 2000

Please read Sections 6.1 and 6.2 of the Schneider and Gersting text, and be prepared to discuss the following:

As I type this, my PC appears to be doing a lot of things simultaneously. Of course it's responding to the keys I type, but it's also playing a CD, keeping track of the time, running Netscape, and holding up another half-dozen windows in which various things are happening. But at the level of machine-language programs, as we saw in the last class, there is really only one thing going on: the computer can only execute one instruction at a time. The operating system creates the illusion that many programs are running in parallel.

From time to time you yourself might be said to be doing a number of things simultaneously, when in fact at some appropriately low level you too can only do one thing at a time. Suppose that it is the evening of April 14, and you have these things to accomplish: finish filling out your tax return; spend some time continuing to read Ulysses for your English class; do a couple of problems on your COS 111 problem set; work on a paper for your History class; and call your Mom before 11 PM. There will probably be some interruptions during your work, such as phone calls from your friends who know that you're an expert on taxes. If you manage your time well, by the end of the evening you will have made appropriate progress on all your tasks, and can continue with many of them the following night.

So, just like the computer, you need some methods and rules for switching your attention from one task to another in an orderly way. When you turn to a new task or resume one that was interrupted by a phone call, you, like the computer, need to be able to pick up where you left off, so that, e.g., you don't start on page 1 of Ulysses each time you pick it up!

Suppose that a bunch of programs and their data are in various separate regions of the computer's memory. By employing the possibly labored analogy above, can you come up with some scheme to make it seem that the programs run simultaneously? Consider that