Shared Memory when it's for read only

ε祈祈猫儿з 提交于 2019-12-11 08:05:34

问题


I am reading beej's guide for Shared Memory Segments

At the end he says:

More commonly, a process will attach to the segment and run for a bit while other programs are changing and reading the shared segment. It's neat to watch one process update the segment and see the changes appear to other processes. Again, for simplicity, the sample code doesn't do that, but you can see how the data is shared between independent processes.

My question is: it is necessary when the shared memory is for read only?


回答1:


The main purpose of shared memory is the Inter-process communication (IPC). But when you make shared memory read only the purpose is defeated.So at least there should be one process which can write into it and then you can make to READ ONLY for rest of the processes.



来源:https://stackoverflow.com/questions/13249037/shared-memory-when-its-for-read-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!