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: 

Queue timeout:clarification

Solved!
Go to solution

Hello everyone,

 

Am trying to understand better the function of the timeout, help says:

timeout in ms specifies the time, in milliseconds, that the function waits for available space in the queue if the queue is full. The default is –1, indicating never to time out.

 

--> I do not understand what it says by waits for available space? Why does it wait for that space? Which available space? And what happens if the timeout is reached? What is the usage of this timeout?

 

Very grateful for responses!

 

0 Kudos
Message 1 of 3
(2,585 Views)
Solution
Accepted by topic author rajiv85

When you create (obtain) a queue you can choose to give the queue a finite size.

If you have a finite size and you have filled it, trying to add more elements simply cannot work.

The code will hang here for the amount of time specified in the timeout. If a space becomes available in this timeframe, the element is added to the queue and code continues as normal.

 

If no space become savailable by the time the timeout expires, the code will continue, but the "timed out" output will be set to TRUE.

Message 2 of 3
(2,568 Views)

Thank you very much!! This was very clearly explained!

0 Kudos
Message 3 of 3
(2,527 Views)