免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: kerryxi
打印 上一主题 下一主题

[内存管理] linear的非共享页面写入操作为什么是创建anon类型的页面? [复制链接]

论坛徽章:
15
射手座
日期:2014-02-26 13:45:082015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15羊年新春福章
日期:2015-02-26 08:47:552015年亚洲杯之卡塔尔
日期:2015-02-03 08:33:45射手座
日期:2014-12-31 08:36:51水瓶座
日期:2014-06-04 08:33:52天蝎座
日期:2014-05-14 14:30:41天秤座
日期:2014-04-21 08:37:08处女座
日期:2014-04-18 16:57:05戌狗
日期:2014-04-04 12:21:33技术图书徽章
日期:2014-03-25 09:00:29
11 [报告]
发表于 2014-06-18 12:21 |只看该作者
这下解释得比较清楚了,也解除了我的困惑,感谢!

论坛徽章:
0
12 [报告]
发表于 2014-06-19 15:21 |只看该作者
回复 10# njuzhyf


代码的意思是你说的,但这就是我困惑的地方: 对于文件的映射,都必须设置共享映射,才能把数据同步到磁盘上去吗?如果设置文件为私有映射,因为是匿名页,就无法同步到磁盘上去? 是这样规定的吗?

论坛徽章:
0
13 [报告]
发表于 2014-06-19 16:32 |只看该作者
回复 12# kerryxi

囧。。。看man手册吧。

      MAP_SHARED Share  this  mapping.   Updates  to  the  mapping  are visible to other processes that map this file, and are carried
                  through to the underlying file.  The file may not actually be updated until msync(2) or munmap() is called.

       MAP_PRIVATE
                  Create a private copy-on-write mapping.  Updates to the mapping are not visible to other processes mapping  the  same
                  file,  and  are not carried through to the underlying file.  It is unspecified whether changes made to the file after
                  the mmap() call are visible in the mapped region.
   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP