02-25-2009 06:55 PM
Hi all,
I am trying to use the producer/consumer architecture in my program. My producer loop is a analog input acquisition loop. I would like to enqueue the acquired data for 3 separate consumers. The first consumer loop would write the data to a file, the second consumer would send the data to the front panel, and the third consumer would send an analog output based on the data.
It seems to me that if any of the consumer dequeue the data, the other consumers would have nothing left to dequeue. I want them to get the same data at the same time. Do I really have to create 3 queues and enqueue the same data to 3 separate queues? Is there a better way? Thanks! |
Solved! Go to Solution.
02-25-2009 07:14 PM
Yes. That is what you need to do. Perhaps someone else knows of some other exotic way to do this, but I think it would be way too complicated.
You can store the queue references in an array. Wrap the enqueue function in a For Loop that takes the queue array in through an autoindexing tunnel.
02-26-2009 07:40 AM