Producer-Consumer Application
A canonical producer-consumer application is built, in which the producer generates data, and the consumer consumes the generated data. Between the producer consumer pair, one process is inserted to process the data.
In the task graph, there are three processes, i.e., one generator process, one consumer
process, and one square
process, with which two FIFO channels are interconnected. At each invocation, the generator
process generates a real number with type double and transfers it to the square
process by Channel C1
. The square
process gets the number, squares it, and sends the result to the consumer
process by Channel C2
. The consumer
receives the result and displays it to on the console.