Memory Mapped Files .NET

后端 未结 4 606
Happy的楠姐
Happy的楠姐 2020-12-01 14:56

I have a project and it needs to access a large amount of proprietary data in ASP.NET. This was done on the Linux/PHP by loading the data in shared memory. I was wondering

4条回答
  •  悲哀的现实
    2020-12-01 15:14

    Memory Mapped files can be used when you have a large amount of data and don't want to incur the cost of marshaling it across process boundaries. I have used it for a similar purpose. You need to be fairly comfortable with unsafe and pinned memory concepts in .NET to take advantage of MMFs. Apparently, the Enterprise Library's caching block contains code which wraps the underlying C# API. I have seen at least one other implementation elsewhere.

    If you can live with the marshaling cost, it's probably easier and more elegant to use some kind of .NET remoting solution.

提交回复
热议问题