亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 5199 | 回復(fù): 13
打印 上一主題 下一主題

怎么讓MMAP禁止同步? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-04-07 15:51 |只看該作者 |倒序瀏覽
想使用MMAP進行共享內(nèi)存操作,但不想讓系統(tǒng)進行內(nèi)存與文件的同步,節(jié)省磁盤IO,應(yīng)該怎么做?

論壇徽章:
0
2 [報告]
發(fā)表于 2008-04-07 16:16 |只看該作者
linux 上好像沒有 MAP_NOSYNC

論壇徽章:
0
3 [報告]
發(fā)表于 2008-04-07 16:24 |只看該作者
好像沒有辦法吧.

論壇徽章:
0
4 [報告]
發(fā)表于 2008-04-07 16:25 |只看該作者
我大概猜到LZ想做什么,也許你只能像memcache那樣使用內(nèi)存,用多線程而不是多進程了.

論壇徽章:
0
5 [報告]
發(fā)表于 2008-04-07 16:28 |只看該作者
MAP_ANONYMOUS

是做這個用的?

論壇徽章:
0
6 [報告]
發(fā)表于 2008-04-07 16:36 |只看該作者
我記得好像有個宏 能提供這個功能

論壇徽章:
0
7 [報告]
發(fā)表于 2008-04-07 17:00 |只看該作者
FREE BSD上用MAP_NOSYNC可以,但LINUX上似乎沒有~

論壇徽章:
0
8 [報告]
發(fā)表于 2008-04-08 11:12 |只看該作者
頂一下

論壇徽章:
0
9 [報告]
發(fā)表于 2008-04-08 11:21 |只看該作者
用 shm_open 就可以了,不要用 mmap

論壇徽章:
0
10 [報告]
發(fā)表于 2008-04-08 13:16 |只看該作者
msync  flushes  changes made to the in-core copy of a file that was mapped into memory using mmap(2) back to disk.  Without use of this call there
       is no guarantee that changes are written back before munmap(2) is called.  To be more precise, the part of the file that corresponds to the memory
       area starting at start and having length length is updated.  The flags argument may have the bits MS_ASYNC, MS_SYNC and MS_INVALIDATE set, but not
       both MS_ASYNC and MS_SYNC.  MS_ASYNC specifies that an update be scheduled, but the call returns immediately.  MS_SYNC  asks  for  an  update  and
       waits  for  it  to  complete.  MS_INVALIDATE asks to invalidate other mappings of the same file (so that they can be updated with the fresh values
       just written).


默認是不同步的
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP