concept divide in category scala

appears as: Divide, divide
Scala in Action

This is an excerpt from Manning's book Scala in Action.

9.3.3. Divide and conquer using actors

In the following example, the challenge is to count the number of words in each file in a given directory and sort them in ascending order. One way of doing it would be to loop through all the files in a given directory in a single thread, count the words in each file, and sort them all together. But that’s sequential. To make it concurrent, we will implement the divide-and-conquer[6] (also called a fork-join) pattern with actors. We will have a set of worker actors handling individual files and a master actor sorting and accumulating the result.