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 (includi ...
, 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 Value_(semiotics), values that convey information, describing quantity, qualitative property, quality, fact, statistics, other basic units of meaning, or simply sequences of sy ...
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 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
Ram, ram, or RAM may refer to:
Animals
* A male sheep
* Ram cichlid, a freshwater tropical fish
People
* Ram (given name)
* Ram (surname)
* Ram (director) (Ramsubramaniam), an Indian Tamil film director
* RAM (musician) (born 1974), Dutch
* ...
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 magne ...
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 (online video / cloud-based video) is the general field that deals with the transmission of digital video over the internet. Internet video exists in several formats, the most notable being MPEG-4i AVC, AVCHD, FLV, and MP3.
There ...
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
In the high-performance computing environment, burst buffer is a fast intermediate storage layer positioned between the front-end computing processes and the back-end storage systems. It bridges the performance gap between the processing speed of ...
that provides distributed buffering service.
A buffer often adjusts timing by implementing a
queue __NOTOC__
Queue () may refer to:
* Queue area, or queue, a line or area where people wait for goods or services
Arts, entertainment, and media
*''ACM Queue'', a computer magazine
* ''The Queue'' (Sorokin novel), a 1983 novel by Russian author ...
(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
Data storage is the recording (storing) of information (data) in a storage medium. Handwriting, phonographic recording, magnetic tape, and optical discs are all examples of storage media. Biological molecules such as RNA and DNA are consi ...
, sending or receiving data to or from a
network
Network, networking and networked may refer to:
Science and technology
* Network theory, the study of graphs as a representation of relations between discrete objects
* Network science, an academic field that studies complex networks
Mathematics ...
, or playing sound on a speaker. A line to a
rollercoaster
A roller coaster, or rollercoaster, is a type of amusement ride that employs a form of elevated railroad track designed with tight turns, steep slopes, and sometimes inversions. Passengers ride along the track in open cars, and the rides are o ...
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 ''i ...
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 synchronou ...
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 medium
Medium may refer to:
Science and technology
Aviation
*Medium bomber, a class of war plane
*Tecma Medium, a French hang glider design
Communication
* Media (communication), tools used to store and deliver information or data
* Medium of ...
used in telecommunications compensates for a difference in rate of flow of
data
In the pursuit of knowledge, data (; ) is a collection of discrete Value_(semiotics), values that convey information, describing quantity, qualitative property, quality, fact, statistics, other basic units of meaning, or simply sequences of sy ...
, 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 in ...
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 b ...
,
* Collecting
binary
Binary may refer to:
Science and technology Mathematics
* Binary number, a representation of numbers using only two digits (0 and 1)
* Binary function, a function that takes two arguments
* Binary operation, a mathematical operation that ta ...
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
DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems.
DOS may also refer to:
Computing
* Data over signalling (DoS), multiplexing data onto a signalling channel
* Denial-of-service attack (DoS), an attack on a communicat ...
.
*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 Modulation#Digital modulati ...
. The
COM port
COM (communication port) is the original, yet still common, name of the serial port interface on PC-compatible computers. It can refer not only to physical ports, but also to emulated ports, such as ports created by Bluetooth or USB adapters. ...
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
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
*
Bucket (computing) In computing, the term bucket can have several meanings. It is used both as a live metaphor, and as a generally accepted technical term in some specialised areas. A bucket is most commonly a type of data buffer or a type of document in which data is ...
*
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 memo ...
*
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 di ...
*
Streaming media
*
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
In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete (though perhaps old) version of the data, rather than a partially updated version of the data being creat ...
and
Triple buffering
In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete (though perhaps old) version of the data, rather than a partially updated version of the data being creat ...
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 the ...
,
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-buffer and ...
, for different parts of image information
*
Variable length buffer
*
Optical buffer
*
MissingNo.
, short for "Missing Number" and sometimes spelled without the period, is an unofficial Pokémon species found in the video games ''Pokémon Red'' and ''Blue''. Due to the programming of certain in-game events, players can encounter MissingNo. ...
, the result of buffer data not being cleared properly in
Pokémon Red and Blue
(an abbreviation for in Japan) is a Japanese media franchise managed by The Pokémon Company, founded by Nintendo, Game Freak, and Creatures, the owners of the trademark and copyright of the franchise.
In terms of what each of those c ...
*
UART buffer
*
ENOBUFS
errno.h is a header file in the standard library of the C programming language. It defines macros for reporting and retrieving error conditions using the symbol errno (short for "error number").International Standard for Programming Language C ...
,
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 inter ...
error caused by lack of memory in buffers
*
Write buffer, 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 bandwi ...
*
512k day
Border Gateway Protocol (BGP) is a standardized exterior gateway protocol designed to exchange routing and reachability information among autonomous systems (AS) on the Internet. BGP is classified as a path-vector routing protocol, and it mak ...
References
{{DEFAULTSORT:Data Buffer
Synchronization
Computer memory