加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

在windows平台上是否有一个内存映射api,就像linux上的mmap()一样

发布时间:2020-12-13 21:07:29 所属栏目:Windows 来源:网络整理
导读:有没有api做内存映射,就像 mmap() 在linux上? File mapping File mapping is the association of a file’s contents with a portion of the virtual address space of a process. The system creates a file mapping object (also known as a section obj
有没有api做内存映射,就像
mmap()

在linux上?

File mapping

File mapping is the association of a file’s contents with a portion of the virtual address space of a process. The system creates a file mapping object (also known as a section object) to maintain this association. A file view is the portion of virtual address space that a process uses to access the file’s contents. File mapping allows the process to use both random input and output (I/O) and sequential I/O. It also allows the process to work efficiently with a large data file,such as a database,without having to map the whole file into memory. Multiple processes can also use memory-mapped files to share data.

Processes read from and write to the file view using pointers,just as they would with dynamically allocated memory. The use of file mapping improves efficiency because the file resides on disk,but the file view resides in memory. Processes can also manipulate the file view with the VirtualProtect function.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读