In
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
, a data buffer (or just buffer) is a region of a memory used to temporarily store
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpret ...
while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an
input device
In computing, an input device is a piece of equipment used to provide data and control signals to an information processing system, such as a computer or information appliance. Examples of input devices include keyboards, mouse, scanners, cameras ...
(such as a microphone) or just before it is sent to an output device (such as speakers). However, a buffer may be used when moving data between
processes
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
*Business process, activities that produce a specific se ...
within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in a fixed memory location in hardware—or by using a virtual data buffer in software, pointing at a location in the physical memory. In all cases, the data stored in a data buffer are stored on a
physical storage medium. A majority of buffers are implemented in
software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
, which typically use the faster
RAM to store temporary data, due to the much faster access time compared with
hard disk drive
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magn ...
s. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler or in
online video streaming. In the
distributed computing
A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another from any system. Distributed computing is a field of computer sci ...
environment, data buffer is often implemented in the form of
burst buffer that provides distributed buffering service.
A buffer often adjusts timing by implementing a
queue (or
FIFO) algorithm in memory, simultaneously writing data into the queue at one rate and reading it at another rate.
Applications
Buffers are often used in conjunction with
I/O to
hardware, such as
disk drives, sending or receiving data to or from a
network, or playing sound on a speaker. A line to a
rollercoaster in an amusement park shares many similarities. People who ride the coaster come in at an unknown and often variable pace, but the roller coaster will be able to load people in bursts (as a coaster arrives and is loaded). The
queue area
Queue areas are places in which people queue ( first-come, first-served) for goods or services. Such a group of people is known as a ''queue'' ( British usage) or ''line'' ( American usage), and the people are said to be waiting or standing '' ...
acts as a buffer—a temporary space where those wishing to ride wait until the ride is available. Buffers are usually used in a
FIFO (first in, first out) method, outputting data in the order it arrived.
Buffers can increase application performance by allowing
synchronous operations such as file reads or writes to complete quickly instead of blocking while waiting for hardware interrupts to access a physical disk subsystem; instead, an operating system can immediately return a successful result from an API call, allowing an application to continue processing while the kernel completes the disk operation in the background. Further benefits can be achieved if the application is reading or writing small blocks of data that do not correspond to the block size of the disk subsystem, allowing a buffer to be used to aggregate many smaller read or write operations into block sizes that are more efficient for the disk subsystem, or in the case of a read, sometimes to completely avoid having to physically access a disk.
Telecommunication buffer
A buffer
routine or
storage
Storage may refer to:
Goods Containers
* Dry cask storage, for storing high-level radioactive waste
* Food storage
* Intermodal container, cargo shipping
* Storage tank
Facilities
* Garage (residential), a storage space normally used to store car ...
medium used in telecommunications compensates for a difference in rate of flow of
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpret ...
, or
time of occurrence of events, when transferring data from one device to another.
Buffers are used for many purposes, including:
* Interconnecting two
digital circuits operating at different rates,
* Holding data for later use,
* Allowing timing corrections to be made on a
data stream
In connection-oriented communication, a data stream is the transmission of a sequence of digitally encoded coherent signals to convey information. Typically, the transmitted symbols are grouped into a series of packets.
Data streaming has ...
,
* Collecting
binary data bits into groups that can then be operated on as a unit,
* Delaying the transit time of a
signal
In signal processing, a signal is a function that conveys information about a phenomenon. Any quantity that can vary over space or time can be used as a signal to share messages between observers. The '' IEEE Transactions on Signal Processing' ...
in order to allow other operations to occur.
Examples
*The
BUFFERS command/statement in
CONFIG.SYS of
DOS.
*The buffer between a serial port (
UART
A universal asynchronous receiver-transmitter (UART ) is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable. It sends data bits one by one, from the least signific ...
) and a
modem
A modulator-demodulator or modem is a computer hardware device that converts data from a digital format into a format suitable for an analog transmission medium such as telephone or radio. A modem transmits data by modulating one or more c ...
. The
COM port speed may be 38400 bit/s while the modem may have only a 14400 bit/s
carrier.
*The integrated buffer on a hard disk drive, printer, BD/DVD/CD drive or other piece of hardware.
*The
framebuffer on a video card.
History
An early mention of a print buffer is the "Outscriber" devised by image processing pioneer Russel A. Kirsch for the
SEAC computer in 1952:
One of the most important
problems in the design of automatic digital computers is that of getting the calculated results out of the machine rapidly enough to avoid delaying the further progress of the calculations. In many of the problems to which a general-purpose computer is applied the amount of output data is relatively big —so big that serious inefficiency would result from forcing the computer to wait for these data to be typed on existing printing devices. This difficulty has been solved in the SEAC by providing magnetic recording devices as output units. These devices are able to receive information from the machine at rates up to 100 times as fast as an electric typewriter can be operated. Thus, better efficiency is achieved in recording the output data; transcription can be made later from the magnetic recording device to a printing device without tying up the main computer.
See also
*
Bucket (computing)
*
Buffer overflow
In information security and programming, a buffer overflow, or buffer overrun, is an anomaly whereby a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory locations.
Buffers are areas of memor ...
*
Buffer underrun
In computing, buffer underrun or buffer underflow is a state occurring when a buffer used for communicating between two devices or processes is fed with data at a lower speed than the data is being read from it. The term is distinct from buffe ...
*
Circular buffer
In computer science, a circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams. Ther ...
*
Disk buffer
In computer storage, disk buffer (often ambiguously called disk cache or cache buffer) is the embedded memory in a hard disk drive (HDD) or solid state drive (SSD) acting as a buffer between the rest of the computer and the physical hard ...
*
Streaming media
Streaming media is multimedia that is delivered and consumed in a continuous manner from a source, with little or no intermediate storage in network elements. ''Streaming'' refers to the delivery method of content, rather than the content i ...
*
Frame buffer for use in graphical display
*
Double buffering and
Triple buffering for techniques mainly in graphics
*
Depth buffer
A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that th ...
,
Stencil buffer, for different parts of image information
*
Variable length buffer
*
Optical buffer
{{Unreferenced, date=November 2010
In telecommunications, an optical buffer is a device that is capable of temporarily storing light. Just as in the case of a regular buffer (telecommunication), buffer, it is a storage medium that enables compens ...
*
MissingNo., the result of buffer data not being cleared properly in
Pokémon Red and Blue
*
UART buffer
*
ENOBUFS
errno.h is a header file in the C standard library, standard library of the C (programming language), C programming language. It defines Macro (computer science), macros for reporting and retrieving error conditions using the symbol errno (short ...
,
POSIX
The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming inte ...
error caused by lack of memory in buffers
*
Write buffer
A write buffer is a type of data buffer that can be used to hold data being written from the cache to main memory or to the next cache in the memory hierarchy to improve performance and reduce latency. It is used in certain CPU cache architectu ...
, a type of memory buffer
*
Zero-copy
"Zero-copy" describes computer operations in which the CPU does not perform the task of copying data from one memory area to another or in which unnecessary data copies are avoided. This is frequently used to save CPU cycles and memory bandwid ...
*
512k day
References
{{DEFAULTSORT:Data Buffer
Synchronization
Computer memory