12-17-2012 09:37 PM
I would have the Release Queue occur after each consumer that handles the respective queue. As you have it now, you could have stuff in the queue, stop the two producer loops and wind up killing the queue before the consumer loops had a chance to finish the queue.
I think you are better off sending the stop command into each of the queues (the queue would be command and the waveform data together). The command might be just a boolean, True to stop the loop, False would continue the loop and tell the loop to act on the waveform data bundled with it.
12-17-2012 11:13 PM
12-18-2012 07:07 AM
A common method is to have your queue data be a cluster that contains and enum or string for the command and then any data you may need. Set your command to "Run" or something of the like when you have actual data for the consumer to process and "Stop" when you are done. When the consumer recieves the Stop command, the loop stops, then destroy the queue. No errors generated.