GDS(Goop Development Suite)

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Reentrancy of ClassName_New.vi

Solved!
Go to solution

Hi all, 

Could anyone explain the reason behind the decision of the reentrancy of ClassName_New.vi (Shared clone) of GDS4 class in the "utils" folder? 

 

The whole architecture seems working fine, even when the reentrancy is set to Non-reentrant. 

 

Thanks for your help

 

Godel

0 Kudos
Message 1 of 3
(1,287 Views)
Solution
Accepted by topic author godel

Hi,
Yes there is one instance when it needs to be Re-entrant.
That is if you use the Design Pattern: Make persistent.
That pattern will outsource the creation of the DVR to a external VI(Process) that won't stop running even if this Create VI becomes idle.
That means the DVR reference is still valid (as soon as the VI who creates a DVR becomes idle the Reference dies).
So we do that by instead of calling "New Data Value Reference" in the _New VI, we call this VI:

MikaelH_0-1671564166028.png

That will outsource the creation of the DVR to this external process, and that VI will call this _New VI again, but now ask it not to outsource the creation of the DVR again.
Does that make sense.
Right click on a class and add the Persistent Design pattern and you'll see that your _New VI of that class will be updated.
BTW when using persistent, you need to stop the external VI(process) before you can modify the class since the class will in use.
You do that with either this VI:

MikaelH_1-1671564378784.png

 

Message 2 of 3
(1,260 Views)

Hi MikaelH, 

Thanks for your kindly explanation. 

 

The way to control the lifetime of an object  (lifetime of a DVR) is so clever. To invoke the <ClassName>_New.vi recurisvely, to avoid deadlock, and to save the memory usage, "shared clone" is the best choice. 

 

Thanks for your kindly explanation again. 

Godel

0 Kudos
Message 3 of 3
(1,246 Views)