详见链接https://www.cnblogs.com/sunsky303/p/8962628.html
1.标准IO

读取的时候,如果kernel space缓存有,直接返回,否则去硬盘加载
写入的时候,写到kernel space缓存中,直接返回。具体什么时候写磁盘由操作系统决定。或显示地调用了sync同步
2.直接IO

相较于标准IO,省略了数据在kernel space中的复制这个环节。
读取的时候,如果user space缓存中没有,直接去磁盘加载。
写的时候,直接写入磁盘。
这种IO主要应用于数据库系统。
3.内存映射(图摘自https://www.cnblogs.com/sunsky303/p/8962628.html)

将硬盘上文件的位置与进程逻辑地址空间中一块大小相同的区域,无需通过read()或write()等系统调用来进行文件读写。
网友评论