父子VI中已排队的消息处理程序VI,其执行类型设置为预分配(?) [英] Queued Message Handler VIs in parent SubVI which execution type is set to be as preallocated (?)

查看:140
本文介绍了父子VI中已排队的消息处理程序VI,其执行类型设置为预分配(?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过LabVIEW创建通信服务器的示例.

I am creating an sample of a communication server through LabVIEW.

在主VI中,我有一个服务器和一个客户端:最后一个的执行设置为预分配的克隆可重入.我使用队列消息处理程序在服务器和客户端之间传输消息和命令.

In the main VI I have a server and clients: Execution of the last is set as preallocated clone reentrant. I use Queued Message Handler to transfer messages and commands between server and clients.

下面的图片是客户端VI(预分配克隆可重入执行),突出显示了排队的消息子VI .在我的

The picture below is the client VI (preallocated clone reentrant execution) with highlighted Queued Message SubVIs. In my previous question I asked about execution type of SubVIs in the Client VIs (preallocated) and got answer that SubVIs need to be preallocated too. But now my question is about Queued Message handler template VIs. Should I set execution type of Queued Message handler template VIs the same as for parent VI?

谢谢

推荐答案

队列消息处理程序VI在我看来似乎具有适当的重入设置.

The Queued Message Handler VIs seem to me to have appropriate reentrancy settings out of the box.

例如,应始终快速执行的Enqueue Message是不可重入的,而Dequeue Message是已预先分配的克隆可重入,它等待队列中没有消息的消息.

For example Enqueue Message, which should always execute quickly, is non-reentrant but Dequeue Message, which waits for a message if there isn't one already in the queue, is preallocated clone reentrant.

您最好考虑一下,因为计时错误比简单的数据值错误要难得多,但是对于大多数目的,我认为您可以相信框架的设计者已经正确选择了.

It's good that you're thinking about this, as timing bugs can be a lot harder to trace than simple data-value bugs, but for most purposes I think you can trust the designers of the framework to have chosen correctly.

如果您对此真的不满意,并且仍然担心错误的重入设置可能会给您带来麻烦,将所有这些VI更改为预分配的克隆可重入并不会真的造成伤害.除非您使用这些VI传递一些庞大的数据结构,否则预分配的克隆所消耗的额外内存应该很小.

If you're really not satisfied by this and are still worried that an incorrect reentrancy setting might be causing you trouble, it won't really hurt to change all these VIs to preallocated clone reentrant. Unless you are using these VIs to pass some huge data structure around, the extra memory consumed by the preallocated clones should be small.

这篇关于父子VI中已排队的消息处理程序VI,其执行类型设置为预分配(?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆