06-26-2014 08:57 AM
crossrulz, I will look over that example. I have a question about queues. I know you first have to obtain a queue then pass in data by enqueuing and then you can dequeue that data from other loops. Lets say I have a producer-consumer model. I have a producer that obtains a queue on the outside of a while loop and enqueues data from a random number generator. Let's say I have two consumer loops (Loop1 and Loop2) that both are waiting for the queue in the producer loop to be enqueued with data. Let's also say Loop1 is running faster that Loop2.
Loop1 and Loop2 are waiting for data to be enqueued and both have "Dequeue Element" to dequeue the data when available. Are these dequeue elements separately handled by each Loop (meaning if I enqueue data from Loop1 will that first data point be lost in Loop2 since the queue has already been dequeued once already)? Or does each dequeue element have access to every piece of data obtained by the queue regardless if a Loop already dequeued an element from the queue?
Thanks so much!
06-26-2014 09:06 AM
Once an element is dequeued, it is gone. So if you have multiple loops trying to dequeue from an queue, you will have no clue which loop will process which queued item. 99.9% of the time, you should only have 1 place where you dequeue. Queues are meant for a N to 1 communications. So you really need a different queue for each loop you are trying to control.
06-26-2014
10:53 AM
- last edited on
05-12-2025
08:57 PM
by
Content Cleaner