
70 Introduction to Concurrency in Programming Languages
What is 2+2?
2+2 is 4.
Thank you.
No problem.
Student A
Student B
FIGURE 4.1: A sequence of messages between two students solving a
homework problem.
work with, but has some tricky details that make efficient message passing
programs challenging to write. For example, if one wants to compute the sum
of a set of numbers distributed across a set of processors, efficient message
exchange patterns based on combining partial results in a tree pattern can
lead to logarithmic time complexity. Similarly, clever patterns exist for other
operations such as broadcasting data to a set of processors from a single
pro ...