是否有任何机制可用于在基于 Windows CLR 的平台上使用 LDMA 或 RDMA?
我希望能够在基于 Windows CLR 的应用程序 (.NET) 上使用 LDMA 或 RDMA。我正在使用 C++ 开发低延迟应用程序,这些应用程序将使用 LDMA 或 RDMA 接收数据。我希望我们的 CLR 应用程序使用相同的 API,但我知道这可能会影响性能。
Windows 有 Windows Direct,但我还没有看到任何允许 .NET 应用程序使用它的东西。我还没有看到 Windows 上真正的 SDP(套接字直接协议)实现。有人知道有什么方法可以实现这一点吗?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以混合托管和非托管代码,则可以使您的 RDMA 实现成为一个库(最好是用 C++ 编写),该库可以完成所有自己的内存管理。
通过 P/Invoke 或 C++/CLI 包装该库。如果您的 api 很健谈,并且具有具有处置语义的有状态 C++ 对象,那么这在 C++/CLI 中会更容易、更好。
然后,您可以在低级别获得完整的 RDMA 性能,并且当您将一些数据从非托管层复制到托管层时(比如为了更容易操作),会产生唯一的 .Net 相关成本。
如果您愿意,通过为非托管内存中的底层数据提供足够丰富的 api,甚至可以避免这种情况。这将产生一些轻微的托管/非托管转换成本,因此对于极其繁琐的界面来说是不合适的,但避免这种情况的真正原因是实施起来相当麻烦,因此与仅提取您的数据相比,它肯定不会是我的第一选择想要进入托管世界。
我不会想到纯托管解决方案可以在没有危险黑客攻击的情况下与 RDMA 一起使用(例如,利用非压缩的 LOH)。
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.
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.
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).
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.
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).