The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Queues and Enumerated Types

SercoSteveB
Active Participant

What are the values of 'Queue Element Out' and 'Timed Out' following execution of the VI?

 

NOTE: The enumerated constant has four defined values Item 1, Item 2, Item 3 & Item 4.

queues#1.png

 

a) Item 1, TRUE

b) Item 2, TRUE

c) Item 3, TRUE

d) Undefined (The VI does not complete)

Comments
crossrulz
Knight of NI

The default value should be the first value in the enum.  So the answer would be A.


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
Pratibha
Member

Ans:- A.

Neelamma
Member

Ans:A

drjdpowell
Trusted Enthusiast

It's (e) Unknown (because for all we know some other process has already obtained "StevesQueue" and enqueued an element before the 100 ms timeout).

Get rid of the queue name and the answer is (a).

GayatriT
Member

Ans : A

Asha_Nagaraj
Member

Ans : A

SercoSteveB
Active Participant

Good point drjdpowelland welcome to The Daily CLAD.  Accessing queues by name, from multiple processes, is an interesting subject.  Could you post what removing the queue name does for this VI?

I encourage you to answer based on the information in the question; fantasy processes are good for making a point but are a real problem when trying to create questions.

drjdpowell
Trusted Enthusiast

The "name" on things like queues and notifiers is something that should almost always be left blank.  The name makes the queue globally accessible, and like any global it should be used only if necessary (and you should think twice to see if it really is necessary).  Without the name, I can trace the wire and tell where the queue is used; with the name, I have to search the entire application for other instances of the name.  With a name like "StevesQueue" it is even possible for another component in the application to accidentally use the same name (better to use "StevesQueue%3F4ru&" or some such randomized name).

In a real-world application, the code you show should only exist because some other process is accessing it through the queue name.

crossrulz
Knight of NI

I think this should illustrate drjdpowell's point.  Now if the queues were not named, this issue would not exist.

Named Queue Example.png


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
SercoSteveB
Active Participant

Thanks drjdpowell & crossrulz.  I have always used queues (with names) to pass data between processes. 

We have a regimented design then development process here so we would never get in the situation where we are accidentally using a queue name over, but it is nice to be aware.

santoshsss
Member

sir, can u explain me in detail about this concept, thank you

crossrulz
Knight of NI

Which concept?  What part are you not understanding.


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
debapriya_maji
Member

Is it that when the queue is empty, the deque function after time-out returns the default value?

crossrulz
Knight of NI

debapriya_maji wrote:


                       

Is it that when the queue is empty, the deque function after time-out returns the default value?


                   

That is exactly what is happening here.


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