Book contents
- Frontmatter
- Contents
- Preface
- 1 Getting started
- 2 Values, operators, expressions and functions
- 3 Tuples, records and tagged values
- 4 Lists
- 5 Collections: Lists, maps and sets
- 6 Finite trees
- 7 Modules
- 8 Imperative features
- 9 Efficiency
- 10 Text processing programs
- 11 Sequences
- 12 Computation expressions
- 13 Asynchronous and parallel computations
- Appendix A Programs from the keyword example
- Appendix B The TextProcessing library
- Appendix C The dialogue program from Chapter 13
- References
- Index
13 - Asynchronous and parallel computations
Published online by Cambridge University Press: 05 May 2013
- Frontmatter
- Contents
- Preface
- 1 Getting started
- 2 Values, operators, expressions and functions
- 3 Tuples, records and tagged values
- 4 Lists
- 5 Collections: Lists, maps and sets
- 6 Finite trees
- 7 Modules
- 8 Imperative features
- 9 Efficiency
- 10 Text processing programs
- 11 Sequences
- 12 Computation expressions
- 13 Asynchronous and parallel computations
- Appendix A Programs from the keyword example
- Appendix B The TextProcessing library
- Appendix C The dialogue program from Chapter 13
- References
- Index
Summary
This chapter is about programs where the dynamic allocation of computer resources like processor time and memory becomes an issue. We consider two different kinds of programs together with programming constructs to obtain the wanted management of computer resources:
1. Asynchronous, reactive programs spending most of the wall-clock time awaiting a request or a response from an external agent. A crucial problem for such a program is to minimize the resource demand while the program is waiting.
2. Parallel programs exploiting the multi-core processor of the computer by performing different parts of the computation concurrently on different cores.
The construction of asynchronous and parallel programs is based on the hardware features in the computer and software features in system software as described in Sections 13.1 and 13.2. Section 13.3 addresses common challenges and pitfalls in parallel programming. Section 13.4 describes the async computation expression and illustrates its use by some simple examples. Section 13.5 describes how asynchronous computations can be used to make reactive, asynchronous programs with a very low resource demand. Section 13.6 describes some of the library functions for parallel programming and their use in achieving computations executing concurrently on several cores.
- Type
- Chapter
- Information
- Functional Programming Using F# , pp. 311 - 338Publisher: Cambridge University PressPrint publication year: 2013
- 1
- Cited by