views:

186

answers:

2

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?

A: 

I have not done something like that, but if I understand your needs correctly, I'd try remoting. This: http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=62 might help.

Update: To clarify things. I Judged that RDMA means Remote Direct Memory Access, but could you please post a link or something about the RDMA you are talking about, because I might be off.

Newszi
+1  A: 

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).

ShuggyCoUk