Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Strictly Typed VI Reference leaves class libraries locked

I have seen this issue before, but replication is tough.  For this occurance, I do not have a simple example to provide, but I am hopeful that this group might have some thoughts on the subject.

Here is the scenario:

Deep in a message handler of a nested actor (called by the Do.vi of the message), I have a Strictly Typed VI Reference.  The output is connected to a terminal of another VI.  Eventually it is connected to a Call By Reference node. 

I run my AF based application.  After I close my AF application, most of the class libraries in the Project Explorer are locked.  I expect that they are all in the call hierarchy of the Strictly Typed VI Ref.  The message handler is dynamic dispatch, shared clone reentrant.  The Strictly Typed VI Ref is Preallocated clone reentrant execution.

If I add the Strictly Typed VI Ref to the launcher of my AF App (e.g. Main.vi), this phenomena does not happen.  But this solution is not practical.

If I make the message handler non-reentrant, it is also OK.  But I prefer reenttrant.

If I make the Strictly Type VI Ref non-reentrant, the libraries are still locked.

This is in LV2012sp1.  I have not tried this in 2013 yet.

Thanks!

Kurt

0 Kudos
Message 1 of 4
(4,464 Views)

I have seen similar (but likely different) behaviour before. This thread helped me - see the post by tst. I had some success with a large lock-prone project after modifying Launch Actor.vi to avoid the static ref.

0 Kudos
Message 2 of 4
(3,048 Views)

This post (post #10) by drjdpowell mentions strictly-typed refs require root loop:

https://decibel.ni.com/content/message/36271#36271

Perhaps the purposely-leaked actor ref is holding on to the strictly-typed ref - similar to how actors don't fully close on exit when DETT is running?

edit:

Oops, the ref gets closed now.

0 Kudos
Message 3 of 4
(3,048 Views)

I finally made a simple example that illustrates my problem - at least it happens on my computer.  It is have attached.  It originated from the LV AF template but I took out Beta Actor and added Gamma Actor that is launched from Alpha.  Plus a few minot tweaks.

The Strictly Typed VI Reference is in Gamma Actor's Task.vi.

You may need to run it twice to get the locking.  It seems that when I recompile the problem does not appear until the subsequent run.

I read the content from the two links given by fabric and Todd.  Thanks!  They gave me solutions/workarounds, but I am still confused why I need to do that.  I do not understand the innerworkings of LabVIEW enough.

By using the Open VI Ref each time and closing when done, the problem disappears, but that is costly.

Conditionally using Open VI Ref and a feedback node or shift register means that I have a leak for each style of these VIs.  Plus if they go stale (which I think they could when say Gamma::Task.vi goes idle), I will need to reopen them.  I am not sure what happens to a stale reference.  Is it actually released?

0 Kudos
Message 4 of 4
(3,048 Views)