简体   繁体   English

Java COM桥

[英]Java COM bridge

I have an ultra-low latency program and need to interface with a Windows COM component. 我有一个超低延迟程序,需要与Windows COM组件接口。 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? 使用像JACOB这样的COM桥或编写本机COM库并使用像ZeroMQ这样的消息总线发送消息?

If you use ZeroMQ, you'll be dealing with two processes. 如果你使用ZeroMQ,你将处理两个进程。 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. 因此,使用Java 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 (eg 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. 如果您的COM组件的延迟已经比进程间消息传递高几倍(例如,因为它通过网络接收和转发消息或执行昂贵的计算),那么任何一个选项都可以,因为它们对整体都有边际影响潜伏。

Note that JACOB doesn't support all COM components, only those with a COM automation interface. 请注意,JACOB不支持所有COM组件,仅支持具有COM自动化接口的组件。 So you might need to use a different Java COM bridge such as JCom. 因此,您可能需要使用不同的Java COM桥,例如JCom。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM