是否有任何机制可以使用LDMA或RDMA在Windows CLR的平台?可以使用、有任何、机制、平台

2023-09-06 09:33:00 作者:死守一世寂寞

我希望能够利用LDMA或RDMA的基于Windows基于CLR的应用程序(.NET)。我已经正在开发的C ++低延迟的应用和这些应用程序将获得使用LDMA或RDMA他们的数据。我希望我们的CLR应用程序使用相同的API的理解是有可能将是一个性能损失。

I want to be able to make use of LDMA or RDMA on a Windows CLR-based application (.NET). I have low-latency applications being developed with C++ and those applications will receive their data using LDMA or RDMA. I'd like our CLR applications to use the same API with the understanding that there is probably going to be a performance hit.

Windows有直接的Windows,但我还没有看到任何东西,它允许.NET应用程序使用它。我还没有看到一个真正的SDP(插槽直协议)实现的Windows。任何人都知道有什么方法可以做到这一点?

Windows has Windows Direct, but I haven't seen anything that allows .NET applications to use it. I have not seen a true SDP (Socket Direct Protocol) implementation for Windows. Anyone know of any way to make this happen?

推荐答案

如果您确定混合托管和非托管code使你的RDMA实现库(pferably $ P $ C ++中),它并不自己所有的内存管理

If you are ok mixing managed and unmanaged code make your RDMA implementation a library (preferably in c++) which does all its own memory management.

总结该库或者通过P / Invoke和C ++ / CLI。如果你的API是健谈,具有状态下与处置语义++对象,这将是更容易,更好地在C ++ / CLI。

Wrap that library either via P/Invoke or C++/CLI. If your api is chatty and has stateful C++ objects with disposal semantics this will be much easier and better in C++/CLI.

然后你得到充分的RDMA的性能在较低水平,唯一的.Net相关的费用,当你从非托管层到管理的一个(说来使其更容易操纵)拷贝一些数据发生。

Then you get full RDMA performance at the low level and the only .Net associated costs are incurred when you copy some data from the unmanaged layer into the managed one (say to make it easier to manipulate).

即使是可以的,如果你想通过提供足够丰富的API在非托管内存中的基础数据是可以避免的。这会产生一些轻微的托管/非托管的过渡费,以便将是不恰当的一个非常健谈的接口,但真正的原因,以避免这将是相当大的麻烦来实现,因此肯定不会是我的这一比例仅为拉数据,您的第一选择想在进入管理世界。

Even that can be avoided if you want by providing a sufficiently rich api to the underlying data in unmanaged memory. This will incur some slight managed/unmanaged transition costs so would be inappropriate for an extremely chatty interface but the real reason to avoid this would be the considerable hassle to implement so it certainly wouldn't be my first choice compared to just pulling the data you want over into the managed world.

我不会想到一个纯粹的管理解决方案将与RDMA无危险的黑客(利用蕙是非压实为例)。

I wouldn't have thought a pure managed solution would work with RDMA without dangerous hacks (making use of the LOH being non compacted for example).