From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

circular buffer

Yes I have a producer consume QMH currently. If using dequeue is it possible to dequeue one element only at a time?

0 Kudos
Message 11 of 14
(813 Views)

A dequeue only pulls 1 element off the queue at a time.


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 12 of 14
(807 Views)

Does use of Array subset and replace array (as used in circular buffer posted in original post) could have potential memory leaks when running with large set of data? Has anyone used the circular buffer and seen any memory issues?

 

0 Kudos
Message 13 of 14
(777 Views)

@sonotk wrote:

Does use of Array subset and replace array (as used in circular buffer posted in original post) could have potential memory leaks when running with large set of data? Has anyone used the circular buffer and seen any memory issues?


I don't see any reason for leaks there, because the LV memory manager is generally good. What you will get is a need for an allocation when you read the data out, but that exists with all other implementations where you have to create a copy of the data. From what I understand of the LV memory manager, it should reuse the memory the next time around if possible, but those are all implementation details.

 

The only way I can think of to avoid the copy is to work with the data inside the subVI. The array subset primitive actually returns a copy to the original data and if you don't give LV a reason to copy it (such as taking it out of the subVI), it will not create a copy. That, of course, prevents you from using the VI as a general circular buffer.


___________________
Try to take over the world!
0 Kudos
Message 14 of 14
(766 Views)