Summary

This lesson summarizes the concepts covered in this chapter.

We'll cover the following

Chapter summary

  • It is an error to execute operations in parallel unless those operations are independent from each other.

  • parallel() accesses the elements of a range in parallel.

  • Tasks can explicitly be created, started, and waited for by task(), executeInNewThread(), and yieldForce(), respectively.

  • The exceptions that are escaped from tasks can be caught later by most of the parallelism functions like yieldForce().

  • asyncBuf() iterates the elements of an InputRange semi-eagerly in parallel.

  • map() calls functions with the elements of an InputRange semi-eagerly in parallel.

  • amap() calls functions with the elements of a RandomAccessRange fully- eagerly in parallel.

  • reduce() makes calculations over the elements of a RandomAccessRange in parallel.

  • map(), amap(), and reduce() can take multiple functions and return the results as tuples.

  • When needed, TaskPool objects other than taskPool can be used.


Get hands-on with 1400+ tech skills courses.