Java COM桥 [英] Java COM bridge

查看:380
本文介绍了Java COM桥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个超低延迟程序,需要与Windows COM组件连接。什么是最快的方法来做到这一点?使用像JACOB这样的COM桥或者写一个本地COM库,并使用ZeroMQ等消息总线发送消息?

I have an ultra-low latency program and need to interface with a Windows COM component. What would be the fastest way to do this? Using a COM bridge like JACOB or write a native COM library and send out messages using a messaging bus like ZeroMQ?

推荐答案

使用ZeroMQ,你将处理两个进程。并且将消息从一个进程传递到另一个进程比在同一进程内执行相同的更昂贵。因此,使用Java COM桥将确保导致更低的延迟。

If you use ZeroMQ, you'll be dealing with two processes. And passing a message from one process to another is more expensive than doing the same within the same process. So using a Java COM bridge will certainly result in a lower latency.

但是,只有在处理极低延迟时,它才是相关的。如果你的COM组件已经具有比进程间消息传递高几倍的延迟(例如,因为它通过网络接收和转发消息或执行昂贵的计算),那么任一选项都可以,因为它们都对整体延迟。

Having said that, it's however only relevant if you're dealing with extermely low latency. If your COM component already has a latency several times higher than inter process message passing (e.g. because it is receiving and forwarding messages over a network or performing expensive computations), then either option will be okay because they both have a marginal effect on the overall latency.

请注意,JACOB不支持所有COM组件,只支持具有COM自动化接口的组件。因此,您可能需要使用不同的Java COM网桥,例如JCom。

Note that JACOB doesn't support all COM components, only those with a COM automation interface. So you might need to use a different Java COM bridge such as JCom.

这篇关于Java COM桥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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