Book contents
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- Part 4 Concurrency and Logic Programming
- 14 Concurrent and Distributed Programming
- 15 The Logic Programming Paradigm and Prolog
- Appendix A Additional Program Examples
- Glossary
- Index
14 - Concurrent and Distributed Programming
from Part 4 - Concurrency and Logic Programming
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- Part 4 Concurrency and Logic Programming
- 14 Concurrent and Distributed Programming
- 15 The Logic Programming Paradigm and Prolog
- Appendix A Additional Program Examples
- Glossary
- Index
Summary
A concurrent program defines two or more sequences of actions that may be executed simultaneously. Concurrent programs may be executed in two general ways:
Multiprogramming. A single physical processor may run several processes simultaneously by interleaving the steps of one process with steps of another. Each individual process will proceed sequentially, but actions of one process may occur between two adjacent steps of another.
Multiprocessing. Two or more processors may share memory or be connected by a network, allowing processes on one processor to interact with processes running simultaneously on another.
Concurrency is important for a number of reasons. Concurrency allows different tasks to proceed at different speeds. For example, multiprogramming allows one program to do useful work while another is waiting for input. This makes more efficient use of a single processor. Concurrency also provides programming concepts that are important in user interfaces, such as window systems that display independent windows simultaneously and for networked systems that need to send and receive data to other computers at different times. Multiprocessing makes more raw processing power available to solve a computational problem and introduces additional issues such as unreliability in network communication and the possibility of one processor proceeding while another crashes. Interaction between sequential program segments, whether they are on the same processor or different processors, raises significant programming challenges.
- Type
- Chapter
- Information
- Concepts in Programming Languages , pp. 431 - 474Publisher: Cambridge University PressPrint publication year: 2002