In
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, a data buffer (or just buffer) is a region of memory used to store
data
Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
temporarily 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, computer mice, scanne ...
(such as a microphone) or just before it is sent to an output device (such as speakers); however, a buffer may be used when data is moved between
processes within a computer, 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 that points at a location in the physical memory.
In all cases, the data stored in a data buffer is stored on a
physical storage medium. The majority of buffers are implemented in
software
Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications.
The history of software is closely tied to the development of digital comput ...
, which typically use
RAM
Ram, ram, or RAM most commonly refers to:
* A male sheep
* Random-access memory, computer memory
* Ram Trucks, US, since 2009
** List of vehicles named Dodge Ram, trucks and vans
** Ram Pickup, produced by Ram Trucks
Ram, ram, or RAM may also ref ...
to store temporary data because of its much faster access time when 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 hard disk drive platter, pla ...
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
Internet video (also known as online video) is digital video that is distributed over the internet. Internet video exists in several formats, the most notable being MPEG-4i AVC, AVCHD, FLV, and MP4.
There are several online video hosting se ...
streaming
Streaming media refers to multimedia delivered through a network for playback using a media player. Media is transferred in a ''stream'' of packets from a server to a client and is rendered in real-time; this contrasts with file downl ...
. In a
distributed computing
Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers.
The components of a distributed system commu ...
environment, data buffers are often implemented in the form of
burst buffers, which provides distributed buffering services.
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 English, British usage) or ''line'' (American English, American usage), and the people are ...
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
Synchronization is the coordination of events to operate a system in unison. For example, the conductor of an orchestra keeps the orchestra synchronized or ''in time''. Systems that operate with all parts in synchrony are said to be synchrono ...
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, which allows 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 medium used in telecommunications compensates for a difference in rate of flow of
data
Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
or
time of occurrence
In forensic investigation, the time of occurrence of an event (such as time of death, time of incident) is one of the most important things to determine accurately as soon as possible. Sometimes this can only be estimated. Some indicators that i ...
of events when data is transferred from one device to another.
Buffers are used for many purposes, including:
* Interconnecting two
digital
Digital usually refers to something using discrete digits, often binary digits.
Businesses
*Digital bank, a form of financial institution
*Digital Equipment Corporation (DEC) or Digital, a computer company
*Digital Research (DR or DRI), a software ...
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 signals to convey information. Typically, the transmitted symbols are grouped into a series of packets.
Data streaming has become u ...
.
* Collecting
binary data bits into groups that can then be operated on as a unit.
* Delaying the transit time of a signal in order to allow other operations to occur.
Examples
*The
BUFFERS command/statement in
CONFIG.SYS of
DOS
DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
.
*The buffer between a serial port (
UART
A universal asynchronous receiver-transmitter (UART ) is a peripheral 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 significant to ...
) and a
modem
The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
. The
COM port speed may be 38400 bit/s while the modem may have only a 14400 bit/s
carrier.
*The integrated
disk buffer
In computer storage, a disk buffer (often ambiguously called a disk cache or a cache buffer) is the embedded memory in a hard disk drive (HDD) or solid-state drive (SSD) acting as a buffer (computer science), buffer between the rest of the com ...
on a hard disk drive, solid state drive or BD/DVD/CD drive.
*The integrated
SRAM buffer on an
Ethernet adapter.
*The
Windows NT kernel also manages a portion of
main memory
Computer data storage or digital data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers.
The central processin ...
as the buffer for slower devices such as
sound card
A sound card (also known as an audio card) is an internal expansion card that provides input and output of audio signals to and from a computer under the control of computer programs. The term ''sound card'' is also applied to external audio ...
s and
network interface controller
A network interface controller (NIC, also known as a network interface card, network adapter, LAN adapter and physical network interface) is a computer hardware component that connects a computer to a computer network.
Early network interface ...
s.
*The
framebuffer
A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
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
*
Buffer overflow
*
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. This requires the program read ...
*
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. The ...
*
Disk buffer
In computer storage, a disk buffer (often ambiguously called a disk cache or a cache buffer) is the embedded memory in a hard disk drive (HDD) or solid-state drive (SSD) acting as a buffer (computer science), buffer between the rest of the com ...
*
Streaming media
Streaming media refers to multimedia delivered through a Computer network, network for playback using a Media player (disambiguation), media player. Media is transferred in a ''stream'' of Network packet, packets from a Server (computing), ...
*
Frame buffer
A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
for use in graphical display
*
Double buffering and
Triple buffering for techniques mainly in graphics
*
Depth buffer,
Stencil buffer
A stencil buffer is an extra data buffer, in addition to the ''color buffer'' and '' Z-buffer'', found on modern graphics hardware. The buffer is per pixel and works on integer values, usually with a depth of one byte per pixel. The Z-buffe ...
, for different parts of image information
*
Variable length buffer
*
Optical buffer
*
MissingNo., the result of buffer data not being cleared properly in
''Pokémon Red'' and ''Blue''
*
UART buffer
*
ENOBUFS,
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 application programming interfaces (APIs), along with comm ...
error caused by lack of memory in buffers
*
Write buffer, a type of memory buffer
*
Zero-copy
In computer science, zero-copy refers to techniques that enable data transfer between memory spaces without requiring the CPU to copy the data. By avoiding redundant copying, zero-copy methods minimize CPU usage and memory bandwidth, leading ...
*
512k day
References
{{DEFAULTSORT:Data Buffer
Synchronization
Computer memory