IPC方法的选择 [英] Choice of IPC method

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

问题描述

我有几个数学 dll,其中一些用于 x64 平台,一些用于 x86.我还需要与几个 COM 接口进行通信(特别是 64 位版本的 Matlab 和 STATISTICA).因此,为了解决混合 dll 的问题,我将我的软件分成 3 个独立的程序 - 其中 2 个是 32 位和 1 - 64 位.所有程序都必须相互通信并连接到相互的 SQL 数据库.此外,有可能一个程序在客户端计算机上运行而另一个程序在服务器计算机上运行.

I have several mathematical dlls, some of them are for x64 platform, some - for x86. I also need to communicate with several COM interfaces (in particular, 64-bit versions of Matlab and STATISTICA). So to solve problem with mixed dlls i splitted my software into 3 independent programs - 2 of them are 32-bit and 1 - 64-bit. All programs have to communicate with each other and also connected to mutual SQL database. Moreover, it is possible, that one program will work on client computer and another one will work on server computer.

连接流程的最佳技术(就性能而言)是什么?我需要非常快速地将数据数组从 x86 程序发送到 x64,执行计算并将它们发回.事实上,使用网络的能力并不重要.

What is the best technology (in terms of performance) to connect processes? I need to really quickly send arrays of data from x86 program to x64, perform calculations and send them back. The ability to use network is not important, in fact.

我只是没有太多时间对不同的方法(管道、WCF 等)进行基准测试,只想专注于研究一种技术.

I just don't have much time to benchmark different methods (pipelines, WCF, etc.) and want to concentrate on studying one technology.

推荐答案

在非托管代码中,COM 可用于此目的(查找进程外服务器,也称为本地服务器).COM 在内部使用 RPC,但比 RPC 更方便,因为客户端使用对象就好像它们在客户端进程自己的地址空间中一样(而它们在服务器进程的地址空间中).COM也可以用于跨计算机通信,查找DCOM.

In unmanaged code, COM can be used for that purpose (look up out-of-process servers, aka local servers). Internally COM uses RPC, but is more convenient than RPC because the client uses objects as though they were in the client process's own address space (whereas they are in the server process's address space). COM can also be used to communicate across computers, look up DCOM.

.NET 中有类似的东西,WCF 就是其中之一,但我不确定它们的效率如何.特别是 WCF 似乎使用基于文本的协议,这可能比 COM 的 RPC 效率低.

There are similar things in .NET, WCF being one of them, but I'm not sure how efficient they are. WCF in particular seems to use text-based protocols, which is probably less efficient than COM's RPC.

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

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