LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues

Solved!
Go to solution

@shamerox wrote:

Then if I release the Queue once that means I am not using the Queue anymore right. Why should I release it as much time as I am obtaining it?


Each time you Obtain Queue, you are creating a new reference.  Assuming you are using named queues to get a reference to a the same queue, you are creating an additional reference to that queue.  Therefore, you need to release the queue for every reference you obtain for that queue.  Only when all of the references have been released with the queue actually be destroyed.


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 11 of 14
(770 Views)

Adding to crossrulz, you can do force destroy to destroy all references in single shot also.

-I just tried to create same and check the results in attached images:

Case 1: Two Obtain Queues used with same name:

Test_None.png

The destop execution trace toolkit trace clearly shows the Reference leaks after the VI execution completes. Also can notice the second Obtain queue details showing Obtain Existing but with different reference.

Test_None_Reference Leak.png

Case 2: With One Release QueueTest_One_release.png-Corresponding trace below the corresponding queue released and the reference leak for other queue. Notice that Release Queue details as Released.

Test_One_Reference Leak.png

Case 3: Using Release Queue for both references

Test_Both.png

-Corresponding Trace below showing First Release Queue as Released and Second one destroys the Queue hence all references are cleared.Test_Both_No_Reference Leak.png

Case 4: Force Destroy

Test_ForceDestroy.png

-Corresponding Trace below showing both queue references destroyed with single usage of reference queue but with Force destroy made TRUE.

Test_One_ForceDestroy.png

 

Hope this clears your question 🙂

Thanks
uday
Message 12 of 14
(752 Views)

Wow!! That's a cool and intuitive way of explaining. Thank you!

 

Just to clear things up, if you want to do both releasing the Queue and destroying all the references created,  at one place, then you can use the Release Queue function with Force destroy enabled. This would not have any reference leaks as depicted by your case 4. So no second thoughts on using it.

Note: I do understand that if any postprocess tries to access the Queue, it would creaete errors.

 

And, that tool you use to trace the processes, is that a LabVIEW addon.

 

 

 

0 Kudos
Message 13 of 14
(745 Views)
0 Kudos
Message 14 of 14
(740 Views)