September 2015
Intermediate to advanced
250 pages
6h 40m
English
Several applications can benefit from multi-cores and multiple threads: fetching a large volume of data from multiple web services, looking up stock prices, analyzing geological data, and so forth. Instead of getting lost in the details of a complex domain and lengthy code, let’s take a relatively small problem that needs very little code. This will help us focus on key issues and explore possible solutions.
We’ll work with a program that finds the number of files in the subdirectory hierarchy starting with a given directory as the root. Here’s a sequential implementation of the code:
| ProgrammingActors/countFilesSequential.scala | |
| | import java.io.File |
| | |
| | def getChildren(file: File) = { |
| | val children = ... |
Read now
Unlock full access