![]() |
|
|
The Producer/Consumer design pattern is based on the Master/Slave pattern, and is geared towards enhanced data sharing between multiple loops running at different rates. As with the standard Master/Slave design pattern, the Producer/Consumer pattern is used to decouple processes that produce and consume data at different rates. The Producer/Consumer pattern's parallel loops are broken down into two categories; those that produce data, and those that consume the data produced.
This particular example, a simulated soda machine, uses an event structure in the producer loop to register user input (depositing/clicking on quarter, dime or nickel), and then pass that event on to the consumer loop for processing.
Read more about Producer/Consumer loops in the Developer Zone document "[Application Design Patterns: Producer/Consumer|http://zone.ni.com/devzone/cda/tut/p/id/3023]."
There are no comments on this document