|
More than One User Task |
Top Previous Next |
|
In the previous section we saw how to build a single-task application. In this section, we shall see how we can generalize this method to applications that include more than one task running in parallel.
We continue with the small case-conversion example by splitting the job performed by upper.c into two tasks, as shown in the diagram below: a driver task to handle file I/O, and a processing task which accepts a stream of words containing ASCII character code values on one of its input ports and sends the corresponding upper-case character codes to one of its output ports.
This example is a bit contrived, but splitting a job up into an I/O task and a number of concurrent computation tasks is commonplace. The folder <3L>My Designs\examples\Lyrtech\Example-2 contains the C source files for the two tasks, driver.c and upc.c, and a suitable configuration file, upc.cfg. They are repeated below for convenience. |