LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW: What makes queues better that array? we can use array as data type to insert element into it and can be read back


@Yeshwant_Biradar wrote:

Thanks for the quick reply!

You can use any datatype in a queue, also arrays

I mean to say that what if we replace queue by array to pass data from producer and consumer?

array also can store data , similarly we insert data in array like  en-queue data in queue.

 

Queues are "unique" in that they support a many-to-one communication…

What does that mean ? Array also can be written by producer and can be read by one consumer

 

what is that array can not do over queue?

I hope now you get my question 


How would you transfer the data from producer to consumer? Via a wire it'll be sequential, via a local you'll get race condition, through a queue you'll solve both problems.

Also, and this might be the reason for the question, a very big array (in the order of several GBs) might not be able to be allocated at once and separating data into chunks and storing them in a queue is a way to handle big data.

So, what's your use case?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 12
(214 Views)

Queues are pretty great in many ways and I use them whenever they make sense.   Occasionally, they aren't the best choice.  For example, if I need non-sequential access to a collection of data, I'm liable to start thinking in terms of an array (possibly packaged in an "Action Engine.") 

 

As mentioned before, the "right" answer will depend on your particular use case.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 12 of 12
(199 Views)