07-28-2008 02:54 PM
One possible advantage of a Notifier to a functional global is the ability to wait for a new updated value. This can be very handy, depending on the app.
"
Now if the AE fired off a Notifier when it executed.... ![]()
Thanks for that reply Kevin! It helped out with a design I am developing.
Ben
07-28-2008 04:38 PM
07-29-2008 08:36 AM
07-29-2008 09:15 AM
I have noticed that queues have a large performance hit, when you use the name to call an existing queue, instead of a wire.
This is the main reason i don't use them. Although i have not tried calling it by reference.....
07-30-2008 07:50 AM
07-30-2008 08:51 AM
Nice trick ! Had never thought of it.
DFGray wrote:Use a master queue to hold queue references to all your other queues.
07-30-2008 09:39 AM
07-30-2008 09:55 AM - edited 07-30-2008 09:55 AM
07-31-2008 08:06 AM
07-31-2008 09:41 AM
DFGray,
I'm interested in your recommendation for single-element queues, and would like to know some of the practical implementation details.
1. Do you create the queue with size=1 originally? If so, does this allow LabVIEW to do some further optimizations?
2. How are "writes" handled exactly? I first picture doing a Deque (and discard) followed by an Enqueue of new data. Is this guaranteed to act "atomically"?
3. How do you choose reasonable timeout values where multiple processes may attempt simultaneous access to the single-element queue? Do you use infinite timeouts (-1)? Or do you use short timeouts and loop around your access attempts? Or some other scheme?
4. Suppose a process succeeds at Dequeue but fails to re-Enqueue leaving the queue empty. How do other processes handle that? Their Dequeues will keep timing out, right?
5. What about error handling? What are the scenarios where you need to add some smarts to the error handling? It seems to me that the possibility of scenario #4 above may dictate that one may sometimes need to perform an Enqueue even if the Dequeue produced an error.
6. When are they significantly more optimal than Notifiers? In the presentation, I see a Dequeue with data forked off to some processing code and also back to Enqueue. It seems that a data copy would be possible, maybe even likely for such a scenario. On the one hand, you want to re-Enqueue immediately to make the operation "atomic", but on the other hand this increases the likelihood that LabVIEW will need to make a copy of the data for processing. Right?
-Kevin P., intrigued and curious