Book contents
- Frontmatter
- Contents
- Preface
- Legend
- 1 Introduction
- 2 Concepts in Concurrent Programming
- 3 An Introduction to Concurrent ML
- 4 CML Programming Techniques
- 5 Synchronization and Communication Mechanisms
- 6 The Rationale for CML
- 7 A Software Build System
- 8 A Concurrent Window System
- 9 A CML Implementation of Linda
- 10 Implementing Concurrency in SML/NJ
- Appendix A A CML Reference
- Appendix B The Semantics of CML
- Bibliography
- Index
1 - Introduction
Published online by Cambridge University Press: 07 October 2009
- Frontmatter
- Contents
- Preface
- Legend
- 1 Introduction
- 2 Concepts in Concurrent Programming
- 3 An Introduction to Concurrent ML
- 4 CML Programming Techniques
- 5 Synchronization and Communication Mechanisms
- 6 The Rationale for CML
- 7 A Software Build System
- 8 A Concurrent Window System
- 9 A CML Implementation of Linda
- 10 Implementing Concurrency in SML/NJ
- Appendix A A CML Reference
- Appendix B The Semantics of CML
- Bibliography
- Index
Summary
Concurrent programming is the task of writing programs consisting of multiple independent threads of control, called processes. Conceptually, we view these processes as executing in parallel, but in practice their execution may be interleaved on a single processor. For this reason, we distinguish between concurrency in a programming language, and parallelism in hardware. We say that operations in a program are concurrent if they can be executed in parallel, and we say that operations in hardware are parallel if they overlap in time.
Operating systems, where there is a need to allow useful computation to be done in parallel with relatively slow input/output (I/O) operations, provide one of the earliest examples of concurrency. For example, during its execution, a program P might write a line of text to a printer by calling the operating system. Since this operation takes a relatively long time, the operating system initiates it, suspends P, and starts running another program Q. Eventually, the output operation completes and an interrupt is received by the operating system, at which point it can resume executing P. In addition to introducing parallelism and hiding latency, as in the case of slow I/O devices, there are other important uses of concurrency in operating systems. Using interrupts from a hardware interval timer, the operating system can multiplex the processor among a collection of user programs, which is called time-sharing. Most time-sharing operating systems allow user programs to interact, which provides a form of user-level concurrency.
- Type
- Chapter
- Information
- Concurrent Programming in ML , pp. 1 - 10Publisher: Cambridge University PressPrint publication year: 1999