09-15-2018 01:42 AM
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?
09-15-2018 06:59 AM
In theory, you can have 2^32-1 references. But you will likely run out of memory first.
09-15-2018 07:40 AM
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?
09-17-2018 12:56 AM
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
09-17-2018 02:23 AM - edited 09-17-2018 02:36 AM
@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.
09-17-2018 03:30 AM
@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!
09-17-2018 02:32 PM - edited 09-17-2018 02:35 PM
@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.