File Mapping
来源:互联网 发布:淘宝的差评怎么删除 编辑:程序博客网 时间:2024/05/01 22:12
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.
The following illustration shows the relationship between the file on disk, a file mapping object, and a file view.
Relationship between the file on disk, a file mapping object, and a file view.
The file on disk can be any file that you want to map into memory, or it can be the system page file. The file mapping object can consist of all or only part of the file. It is backed by the file on disk. This means that when the system swaps out pages of the file mapping object, any changes made to the file mapping object are written to the file. When the pages of the file mapping object are swapped back in, they are restored from the file.
A file view can consist of all or only part of the file mapping object. A process manipulates the file through the file views. A process can create multiple views for a file mapping object. The file views created by each process reside in the virtual address space of that process. When the process needs data from a portion of the file other than what is in the current file view, it can unmap the current file view, then create a new file view.
When multiple processes use the same file mapping object to create views for a local file, the data is coherent. That is, the views contain identical copies of the file on disk. The file cannot reside on a remote computer if you want to share memory between multiple processes.
For more information, see the following topics:
- Creating a File Mapping Object
- Creating a File View
- Sharing Files and Memory
- Reading and Writing From a File View
- Closing a File Mapping Object
- File Mapping Security and Access Rights
- Using File Mapping
http://msdn.microsoft.com/en-us/library/aa366556(VS.85).aspx
- Mapping File
- file mapping
- File Mapping
- File Mapping
- 3-Hibernate mapping file
- DLL file mapping
- File Mapping析疑
- File Mapping析疑
- POJ 1057 FILE MAPPING
- File mapping的用法
- 【转】File Mapping技术
- poj 1057-File mapping
- redis file mapping
- 【poj1057】FILE MAPPING 模拟
- POJ 1057 FILE MAPPING
- File Mapping的简单使用
- 内存映射文件File Mapping
- complete mapping file between ids
- 使用虚拟机技术制作USB盘上操作系统
- openfiler 搭建虚拟存储 并 配置服务端
- RSA算法
- struts2 重复提交拦截器用法 token与token-session
- struts2 自定义拦截器
- File Mapping
- 正在建構中......
- Welcome to my blogger
- ARP IP&MAC绑定
- c#编写XML读写删改功能
- C#.net读写XML文件
- 【windows程序设计】 建立窗口的几种方法
- 难道我真的只是你生命中的过客?
- Log4J日志管理类使用详解