We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
嗯,.NET框架是免费的,推荐。 .NET 4.0 支持 System.IO.MemoryMappedFiles 命名空间类。共享内存与垃圾收集器的概念存在相当大的阻抗不匹配,这就是为什么它需要一段时间。除非使用指针,否则从 GC 堆复制到 MMF 视图是不可避免的。
其他 IPC 机制也使用共享内存,只是它不是明确的,因为它内置于内核中。这一切都以大致相同的速度运行,一微秒来设置映射,然后仅使用总线带宽来进行内存到内存的复制。每秒 5 GB 是您遇到的最慢速度。
Well, the .NET framework is free, recommended. .NET 4.0 supports the System.IO.MemoryMappedFiles namespace classes. Shared memory is a fairly drastic impedance mismatch with the notion of a garbage collector, that's why it took a while. Unless you use pointers, copying from the GC heap to the MMF view is inevitable.
The other IPC mechanisms use shared memory too, it just isn't explicit since its built into the kernel. This all runs at roughly the same speed, a microsecond to setup the mapping and then just the bus bandwidth to do the memory-to-memory copy. Five gigabytes per second is the slowest you'll run into.
听起来您正在寻找 内存映射文件,这些文件受支持.NET 4.0 BCL。
Sounds like you are looking for Memory-Mapped Files, which are supported in the .NET 4.0 BCL.