04-07-2008 08:02 PM
04-07-2008 10:44 PM
Queues work very well and I use them to keep code re-usable in the same manner that you describe
if you are worried about contention issues with many loops trying to use the same queues then use semaphores to lock and unlock after each queue operation
If you are using Real-Time applications there is a RT fifo which has a nice feature that you can read and write at the same time.
04-07-2008 10:56 PM
04-08-2008 10:37 AM
04-08-2008 10:43 AM - edited 04-08-2008 10:48 AM
04-08-2008 10:47 AM
Adding to Mike's (he sits on the other side on the wall from me) reply...
In early version of LV (prior to LV 6) the queues were implelemented as strings only. This made them slower than Action Engines do to the work required to flatten and un-flatten on the way in and the way out of the queue.
I benchmarked the polymorphic versino of the queues in LV 6.0 and they out performed anything I could write.
Queues are very efficient and provided you are not branching wires (forcing data copies) the queues are capable of passing data "in-place" meaning that the buffer holding the data when queued up are the same buffers used when the data is de-queued.
The Que VI's were developed by Stephen Mercer and he did a wonderful job with them. He does not monitor this forum but he does frequent LAVA, mostly to support LVOOP his most recent brain-child.
I hope this helps!
Ben
04-08-2008 11:02 AM
04-08-2008 12:04 PM
My LabVIEW instructor explained it similarly....as basically a very very low level processor function that acts like an interupt (Software Trap?)
Ben wrote:
JC... wrote"What I have found suggests that dequeue element is very efficient and does not "poll", but works on an "interupt" basis.
http://forums.ni.com/ni/board/message?board.id=170&message.id=144984
He says, after talking to another colleague of his, that this can not be."Although I know and love Shane I have to split hairs when it comes to the interupts. Interupts are hardware dependent and LabVIEW (being cross-platfom) would have to bend over-backwards to use interupts to handle queues. "Softweare Traps", maybe.Ben