Unbuffered I/O
来源:互联网 发布:手机测试网络稳定性 编辑:程序博客网 时间:2024/05/06 11:28
Unbuffered I/O在概念上是相对于Buffered I/O(标准I/O),他的读写函数read,write都会触发系统的内核调用。Unbuffered I/O并不是说不使用Cache机制,一般来说Unix系统都会在内核中使用Buffer Cache 或者 Page Cache。当我们使用write来写数据到磁盘文件时,这些数据一般会被copy到内核的cache中排列起来,在之后某个时刻写到磁盘,这被称作延迟写。
APUE 2 中是这样解释的:Traditional implementations of the UNIX System have a buffer cache or page cache in the kernel through which most disk I/O passes. When we write data to a file, the data is normally copied by the kernel into one of its buffers and queued for writing to disk at some later time. This is called delayed write.
内核最终需要将cache中的数据写入磁盘,这样保证数据文件一致性,并使得cache可以重用。sync,fsync和fdatasync可用来进行数据同步。
sync:触发cache数据的写入磁盘操作,但是它会直接返回不会等操作结束。
fsync:针对单个文件,等待cache数据写入磁盘完成后返回。
fdatasync:与fsync相似,但是它只针对文件的数据部分。
- Unbuffered I/O
- unbuffered 文件I/O
- unbuffered I/O. buffered I/O
- unbuffered I/O. buffered I/O<转载>
- unbuffered I/O. buffered I/O<转载>
- 标准C库和unbuffered I/O
- tcflush与unbuffered I/O,buffered I/O
- tcflush与unbuffered I/O,buffered I/O
- [Unix/Linux Programming] Buffered I/O vs Unbuffered I/O
- unbuffered i/o 与 standard i/o 区别
- 标准I/O库与Unbuffered I/O(不带缓冲的I/O)函数
- 读书笔记-APUE第三版-(3)Unbuffered I/O
- UNIX环境高级编程——标准I/O库函数和Unbuffered I/O函数
- 【linux系统编程】C标准I/O函数和系统无缓冲函数(Unbuffered I/O函数)关系
- I/O
- I/O
- I/O
- I/O
- 回车和换行
- Domino中实现横向打印功能
- 记10.24日(周六)6:00至10:41寻梦记
- 开始进军ring0
- 修炼成QTP高手的十个步骤
- Unbuffered I/O
- 第5章 初始化与清理
- test
- 字符串多模式精确匹配(脏字/敏感词汇搜索算法)——TTMP算法 之理论如此
- 字符串多模式精确匹配(脏字/敏感词汇/关键字过滤算法)——TTMP算法 之实战F模式
- 数据库备份与u盘挂载
- 漂亮MM想嫁有钱人 金融家的回复令人叫绝
- C语言与数据库连接
- Framebuffer编程How-to