LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue vs DVR

I'm working on implementing an architecture that's very heavily reliant on queues for data transfer.

 

However, I recently ran into a use case where I need to maximize the speed at which data is transferred from one thread to another.

 

Do DVRs provide a higher speed than queues? I tend to think of both as pointer type mechanisms, but I don't fully understand the internals.

0 Kudos
Message 1 of 6
(2,254 Views)

A Queue is a buffer, typically a FIFO variety (you can use the Enqueue From Opposite End to make it a LIFO).

 

A DVR is a single value.

 

So you are talking about two completely different things here.

 

Generally speaking, a queue is the fastest way to pass data between two loops without losing any data.  If you only care about the latest value, I would probably lean toward a Notifier since it will not cause the producer to be blocked while the consumer reads the value as you would with a DVR.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,218 Views)

I should have been a little more specific. I'm deciding between a single element lossy queue (using preview queue on the reader side) and DVR.  I believe notifiers behave basically the same way as the single element queue, but I am likely wrong about that.  I do tend to use them the same way though...

 

Basically I'm wondering if DVR's have less overhead than queues or notifiers.  

0 Kudos
Message 3 of 6
(2,202 Views)

@plus1etal wrote:

I should have been a little more specific. I'm deciding between a single element lossy queue (using preview queue on the reader side) and DVR.  I believe notifiers behave basically the same way as the single element queue, but I am likely wrong about that.  I do tend to use them the same way though...

 

Basically I'm wondering if DVR's have less overhead than queues or notifiers.  


Are you trying to use a DVR as some kind of fancy global variable?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,195 Views)

In essence, yes. I can't use globals because the processes are dynamically launched, factory style.  So no named variables.

 

Edit: This is a reply to Bill.  I'm not sure why it didn't do the normal reply format.

0 Kudos
Message 5 of 6
(2,174 Views)

@plus1etal wrote:

In essence, yes. I can't use globals because the processes are dynamically launched, factory style.  So no named variables.


Do you care to know when a new value has been received or just what the current value is?

 

Typically, my parallel loops are of a Queued Message Handler variant.  So I will use the message queue to tell the process that a value has been updated.  If you want more of a broadcast method, User Events are handy.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,164 Views)