Chapter 6. Parallelism

This chapter covers

  • Exploring the importance of parallelism
  • Examining concurrency versus parallelism
  • Getting to know threads in Nim
  • Advanced parsing of data using regular expressions and other means
  • Parallelizing the parsing of large datasets

Every computer program performs one or more computations, and these computations are usually performed sequentially. That is, the current computation has to complete before the next one starts. For example, consider a simple calculation, (2 + 2) x 4, in which the addition must be computed first, to give 4, followed by the multiplication, to give 16. In that example, the calculation is performed sequentially.

Concurrency allows more than one computation to make progress without ...

Get Nim in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.