... continued

Continues the discussion on pools and describes the map API.

We'll cover the following...

In the previous section we discussed the simplest API offered by the Pool class. However, it offers a much more powerful map() API. The name may ring a bell with readers who have background in big data or have worked with the famous map-reduce programming paradigm.

map reduce

Very briefly, the idea behind map-reduce is dividing a very large problem into smaller chunks that can be worked upon independently from each other. The chunks are distributed among different processing units and as the results for each chunk become ready, they are sorted and passed through a user-provided reducer function which defines the logic for combining all the results. Many real-world problems can be modeled on the lines of the map-reduce programming paradigm and be solved much faster.

map ( )

The Pool class's map API breaks up the problem size into smaller chunks and distributes them off to various processes but it doesn't get as sophisticated as the original map-reduce model, rather it simply aggregates all the results in the same order as it received the input and ...