全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Buffered input and output, flush?

又称: buffered input and output · flush

Definition 14.2 University Computer Science — Year 2 · 第 14 章 — Files, Pipes and Signals

Buffered input and output gathers many small reads or writes of a program into few system calls, through a block of memory, the buffer, kept in the process: the C library’s FILE streams do this. To flush a buffer is to write its contents with a system call. An output stream is fully buffered (flushed when full, or at exit), line buffered (also at each newline; the default for a terminal) or unbuffered (stderr).

The times of . Up to about 1 KiB the line falls with slope -1: the time is the number of system calls. Beyond, the cost of moving the bytes themselves dominates, and a larger buffer gains little.
The times of Output 14.6. Up to about 1 KiB the line falls with slope −1-1: the time is the number of system calls. Beyond, the cost of moving the bytes themselves dominates, and a larger buffer gains little.
在原文中阅读 →