Posix共享内存与映射文件 [英] Posix shared memory vs mapped files
本文介绍了Posix共享内存与映射文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以了解到有关该主题的知识,那么POSIX共享内存(shm_open)和POSIX映射文件(mmap)的真正区别是什么?
Having learnt a bit about the subject, can anyone tell, what is the real difference between POSIX shared memory (shm_open) and POSIX mapped files (mmap)?
两者似乎都使用/dev/tmpfs子系统,而不是使用较旧的IPC机制.
Both seems to use the /dev/tmpfs subsystem, rather then older IPC mechanism.
那么使用mmap文件而不是共享内存有什么优势?
So is there any advantage of using mmap file over shared memory?
谢谢.
推荐答案
区别并不总是很清楚.共享内存可以通过内存映射文件来实现. 在此可以找到很好的文章(如应用于C/C ++编程.)
The distinction is not always clear. Shared memory can be implemented via memory mapped files. An excellent write on this can be found here (as applied to C/C++ programming).
这篇关于Posix共享内存与映射文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文