LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Max Queue Number

Hey everyone,

 

Is there any maximum number of queues in a program that can be handled? does the increasing number of different queues affect the computational efficiency or performance?

0 Kudos
Message 1 of 7
(3,935 Views)

In theory, you can have 2^32-1 references.  But you will likely run out of memory first.


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
Message 2 of 7
(3,903 Views)

Increasing the number of queues has no effect on a queues performance.   Essentially a queue is a reference to a memory location.   

 

Increasing the number of elements in an unlimited queue may cause memory reallocation that take a finite but small amount of time to find the new memory location and move the data. 

 

What concerns me is why you would think about asking?  So, is this a academic type of question or do you have a particular problem that you are thinking about tossing a gazillion queues into? If the latter, have you seen the Actor Framework?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(3,900 Views)

Thank you for attention. It is not a academical type of question. We are using many number of queues in our program that runs minimum 5-6 parallel loops, and sometimes the data types and size also be large enough to concern. I'm trying to make it more simple and elegant and also safer to solve the computational problems even before they cause problems.

 

I didnt see the actor framework; some people just mentioned before hence, I dont have any idea whats going on? If you can lead me to a good source to learn and practice that kind of stuff, it will be very appreciated though.

 

thank you

0 Kudos
Message 4 of 7
(3,867 Views)

@crossrulz wrote:

In theory, you can have 2^32-1 references.  But you will likely run out of memory first.


Not really true.

 

Instantiating a queue of the SAME datatype will give you maximum 2^20 instances before LabVIEW gives you an "out of memory" error.

 

To paraphrase RolfK (from an inaccessible forum), a Queue Refnum is a magic cookie.  12 bits are pseudorandom, 20 bits are instances in the cookie jar.  A single LabVIEW instance has a single cookie jar, so exhausting the 2^20 references has severe effects in that application instance.

 

I am not 100% sure if the 2^20 refers to the amount of queues in general or only within a specific datatype.....

 

Not sure if this is the same in LV 64-bit or recent versions of LabVIEW.  I last tested this in LV 2015 I believe.

Message 5 of 7
(3,858 Views)

@JÞB wrote:

So, is this a academic type of question or do you have a particular problem that you are thinking about tossing a gazillion queues into? If the latter, have you seen the Actor Framework?


So that's what the actor framework is for: I don't have to create tons of queues myself to see when LabVIEW crashes! Smiley Very Happy

Message 6 of 7
(3,836 Views)

@Intaris wrote:

@crossrulz wrote:

In theory, you can have 2^32-1 references.  But you will likely run out of memory first. 

Not sure if this is the same in LV 64-bit or recent versions of LabVIEW.  I last tested this in LV 2015 I believe.


It's per refnum type (Queue, Notifier, Semaphore, DVR, File, TCP, UDP, VISA, IMAQdx, etc, etc). And yes they may fine tune this in different LabVIEW versions somewhat. In older versions (7.x) it used to be 2^16, but I guess that turned out to be a potential problem for larger Actor based frameworks and therefore was extended at some point. 64-bit LabVIEW won't likely change anything as a LabVIEW refnum is always a 32-bit entity even in 64-bit LabVIEW.

Rolf Kalbermatter
My Blog
Message 7 of 7
(3,784 Views)