Previous | Next | Table of Contents | Index | Program List | Copyright

Chapter 16

Introduction to Concurrent Programming


16.1 Problem Solving: What Is Concurrent Programming?
16.2 System Structures: Task Types and Task Objects
16.3 System Structures: Protected Types and Protected Objects
16.4 Continuing Saga: Multiple Concurrent Spiders
Chapter Review

Each program we have seen so far has been a sequential, or single-threaded, one, that is, it has consisted of a series of steps that are executed in sequence, one after the other. In this chapter we introduce the idea of a concurrent, or multithreaded, program, one in which several things can happen--or at least, appear to happen--simultaneously.

Concurrent actions are really a part of most interesting programs. For example, a time-shared operating system must deal with a number of human users working simultaneously at their terminals. Further, many real-time applications, especially those controlling physical processes, are composed of concurrent program segments, each responsible for its own physical subsystem. Finally, the world is concurrent, filled with people doing different things all at the same time, and a program that would model that world is best seen as comprising concurrent program segments.

This chapter introduces you to the fascinating field of concurrent programming, which is the writing of concurrent programs. Ada provides an especially rich and interesting set of structures for concurrent programming; this chapter presents some of these structures. In particular, we introduce Ada task types and protected types. A task object is an active program, carrying on its activities independently of other tasks and interacting with others only where necessary. A protected object is passive; its purpose is to encapsulate a data structure and provide services to tasks upon request, allowing many tasks to view the structure simultaneously but authorizing only one task at a time to modify the structure.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.