CPSC 100: Principles of Computer Science
Spring 1997
Week 8 Reading Guide

This is the eighth of the weekly reading guides for Computer Science 100.

Week 8 (May 19 to May 23)

The second in-class test for this course will be next Monday, May 26. It will cover material that we have done since the previous test. It will not include material that we cover this week. That is, the test will cover: Sections 1 and 3 of Chapter 5, Chapter 6, and Sections 1 through 3 of Chapter 7.

The reading for this week is Chapter 10, on "Cooperating Computers." However, you will never be tested on Section 2.

Up until now, we have been talking about how a single computer with a single CPU works. In this chapter, we move on to the question of how several CPU's can work together in one multiprocessing computer and how several computers can work together on a network.

A multiprocessing computer is one that has more than one CPU. On such a computer, each CPU can be executing a different process. Some problems can be solved by creating several processes to work on different parts of the process. In parallel processing, these processes are executed at the same time, by different CPU's. Distributed processing is a kind of parallel processing where the processes are actually executed on different computers, connected by a network.

Parallel processing requires the ability to create and destroy processes, and to allow for communication among processes. One way for processes to communicate is to use shared variables. Problems can arise if more than one process tries to use a shared variable at the same time. Access to shared variables can be controlled by using critical regions -- sections of a program where a process gets exclusive access to shared variables.

Even when a program is going to be run on a regular, non-multiprocessing computer, it is often natural to break down a problem into multiple processes. These processes can then be run on a single-CPU computer using timesharing. The xTurtle programming language has some support for a simple form of multiprocessing. The fork command is used to create multiple processes, and the grab command is used to gain exclusive access to shared variables.

We can also consider computers that communicate over a network. Computers use various protocols for network communication. One of the most common is TCP/IP, which is the basis of communication on the Internet. Higher-level protocols such as FTP and Telnet use TCP/IP to send data back and forth from one computer to another. You have already have some experience with the Internet and network protocols in previous labs. The lab this week will cover some of the basic TCP/IP concepts.

Concept List for Chapter 10 and Friday's lab: