问题描述
我有一个VI,其执行类型设置为预先分配的克隆可重入.在VI中,我有几个SubVI.子VI的执行类型应设置为与主VI相同吗?
I have got a VI which execution type is set to be as preallocated clone reentrant.In the VI i have several SubVIs. Should I set the execution type of SubVIs the same as in the main VI?
谢谢
推荐答案
将VI设置为可重入并不会自动使其子VI重入-如果这样做,这将破坏非重入VI的某些用例,例如序列化对单个资源的访问或维护调用之间的存储状态数据.因此,要确定子VI是否需要重入,只需与确定父VI是否需要重入时所考虑的问题相同.
Setting a VI to be reentrant doesn't automatically make its subVIs reentrant - if it did, this would break some of the use cases for non-reentrant VIs, such as serialising access to single resources or maintaining stored state data between calls. So to decide whether a subVI needs to be reentrant, you just have to consider the same issues as you did when deciding whether the parent VI needed to be reentrant.
我在这篇由 GregR 在LAVA论坛上发布的帖子至今仍然有效我可以看到(完全可重入是较早的LabVIEW术语,用于预分配克隆可重入):
I found a good summary of the considerations in this post by GregR on the LAVA forum, which still holds true as far as I can see (fully reentrant was the older LabVIEW term for preallocated clone reentrant):
这篇关于我是否应该在LabVIEW中也将预分配VI中的子VI设置为预分配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!