Concurrency Patterns
The way we organize our concurrent work is pretty much the same in every application. We will look at one common pattern that is called a pipeline, where we have a source, and then messages are sent from one routine to another until the end of the line, until all the routines in the pipeline have been utilized. Another pattern is the fan out/ fan in pattern where, as in the previous exercise, the work is sent to several routines reading from the same channel. All these patterns, however, are generally made of a source stage, which is the first stage of the pipeline and the one that gathers, or sources, the data, then some internal steps, and at the end a sink, which is the final stage where the results of the process from all the other routines get merged. It is known as a sink because all the data sinks into it.
Activity 16.02: Source Files
In this activity, you will create a program that will read two files at the same time containing some numbers. You...