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
7 - A Software Build System
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
A natural application of concurrency is the management of multiple independent tasks. For example, building a large C program involves a number of individual compilations, each of which is run as a separate UNIX command. Since these compilations are independent, they may be run at the same time (possibly on different machines). In this chapter, we describe the implementation of a “parallel” build system using CML.
The problem
The basic problem is that we are given a set of objects, and a set of dependencies between the objects. Associated with some objects is an action that describes how to build the object; other objects (e.g., source files) do not have associated actions. Taken together, they form an acyclic dependency graph, whose topological order defines the order in which objects should be built. We use the term antecedents to denote the nodes that a node depends on, and successors to denote the nodes that depend on it. The nodes of the graph are classified into internal nodes (those that have non-zero in-degree), leaf nodes (those with no antecedents), and the root node (which has no successors). We restrict ourselves to graphs with exactly one root. For the graph to be well formed, any internal node should have an associated action. Leaf nodes may also have actions.
Also associated with each object is a timestamp that tells when the object was last built or modified.
- Type
- Chapter
- Information
- Concurrent Programming in ML , pp. 131 - 144Publisher: Cambridge University PressPrint publication year: 1999