12-19-2022 11:55 PM
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
.
Solved! Go to Solution.
12-20-2022 02:39 PM - edited 12-21-2022 02:15 PM
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:
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:
12-21-2022 02:02 AM
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