Buffer (computer science)
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, a buffer is a region of a physical memory storage used to temporarily hold data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 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
Input device
In computing, an input device is any peripheral used to provide data and control signals to an information processing system such as a computer or other information appliance...

 (such as a mouse) or just before it is sent to an output device (such as speakers). However, a buffer may be used when moving data between processes
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 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 media. A majority of buffers are implemented in software, which typically use the faster RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 to store temporary data, due to the much faster access time compared with Hard Disk Drives. 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
Video hosting service
A video hosting service allows individuals to upload video clips to an Internet website. The video host will then store the video on its server, and show the individual different types of code to allow others to view this video...

 streaming
Streaming media
Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming provider.The term "presented" is used in this article in a general sense that includes audio or video playback. The name refers to the delivery method of the medium rather...

.

A buffer often adjusts timing by implementing a queue (or FIFO
FIFO
FIFO is an acronym for First In, First Out, an abstraction related to ways of organizing and manipulation of data relative to time and prioritization...

) 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
I/O
I/O may refer to:* Input/output, a system of communication for information processing systems* Input-output model, an economic model of flow prediction between sectors...

 to hardware
Hardware
Hardware is a general term for equipment such as keys, locks, hinges, latches, handles, wire, chains, plumbing supplies, tools, utensils, cutlery and machine parts. Household hardware is typically sold in hardware stores....

, such as disk drives, sending or receiving data to or from a network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

, 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 area
Queue areas are places in which people queue for goods or services. Examples include checking out groceries or other goods that have been collected in a self service shop, in a shop without self service, at an ATM, at a ticket desk, a city bus, or in a taxi stand.Queueing is a phenomenon in a...

 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
FIFO
FIFO is an acronym for First In, First Out, an abstraction related to ways of organizing and manipulation of data relative to time and prioritization...

 (first in, first out) method, outputting data in the order it arrived.

Telecommunication buffer

A buffer routine
Routine
Routine may refer to:*Subroutine in computer science*Choreographed routine, orchestrated dance involving several performers*Comedy routine, comedic act or part of an act*Visual routine, visual cognitive means of extracting information from a scene...

 or storage
Data storage device
thumb|200px|right|A reel-to-reel tape recorder .The magnetic tape is a data storage medium. The recorder is data storage equipment using a portable medium to store the data....

 medium used in telecommunications compensates for a difference in rate of flow of data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

, or time of occurrence
Time of occurrence
In forensic investigation, the time of occurrence of an event is one of the most important things to determine accurately as soon as possible...

 of events, when transferring data from one device to another.

Buffers are used for many purposes, such as
  • interconnecting two digital
    Digital
    A digital system is a data technology that uses discrete values. By contrast, non-digital systems use a continuous range of values to represent information...

     circuits operating at different rates,
  • holding data for use at a later time,
  • allowing timing corrections to be made on a data stream
    Data stream
    In telecommunications and computing, a data stream is a sequence of digitally encoded coherent signals used to transmit or receive information that is in the process of being transmitted....

    ,
  • collecting binary
    Binary numeral system
    The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

     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.

Buffer versus cache

A cache
Cache
In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...

 often also acts as a buffer, and vice versa. However, cache operates on the premise that the same data will be read from it multiple times, that written data will soon be read, or that there is a good chance of multiple reads or writes to combine to form a single larger block. Its sole purpose is to reduce accesses to the underlying slower storage. Cache is also usually an abstraction layer
Abstraction layer
An abstraction layer is a way of hiding the implementation details of a particular set of functionality...

 that is designed to be invisible.

A 'Disk Cache' or 'File Cache' keeps statistics on the data contained within it and commits data within a time-out period in write-back modes. A buffer does none of this.

A buffer is primarily used for input, output, and sometimes very temporary storage of data that is either enroute between other media or data th may be modified in a non-sequential manner before it is written (or read) in a sequential manner.

Good examples include:
  • The BUFFERS command/statement in CONFIG.SYS
    CONFIG.SYS
    CONFIG.SYS is the primary configuration file for the DOS, OS/2 as well as similar operating systems. It is a special file that contains setup or configuration instructions for the computer system.- Usage :...

     of DOS
    DOS
    DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

    .
  • The buffer between a serial port (UART) and a MODEM. The COM port speed may be 38400 bit/s while the MODEM
    Modem
    A modem is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information. The goal is to produce a signal that can be transmitted easily and decoded to reproduce the original digital data...

     may only have a 14400 bit/s carrier
    Carrier wave
    In telecommunications, a carrier wave or carrier is a waveform that is modulated with an input signal for the purpose of conveying information. This carrier wave is usually a much higher frequency than the input signal...

    .
  • The integrated buffer on a Hard Disk Drive, Printer or other piece of hardware.
  • The Framebuffer
    Framebuffer
    A framebuffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.The information in the memory buffer typically consists of color values for every pixel on the screen...

     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
SEAC (computer)
SEAC was a first-generation electronic computer, built in 1950 by the U.S. National Bureau of Standards and was initially called the National Bureau of Standards Interim Computer, because it was a small-scale computer designed to be built quickly and put into operation while the NBS waited for...

 in 1952

One of the more serious 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 great—so great 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)
    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 divided into regions.-Features of a...

  • Buffer overflow
    Buffer overflow
    In computer security and programming, a buffer overflow, or buffer overrun, is an anomaly where a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory. This is a special case of violation of memory safety....

  • Buffer underrun
    Buffer underrun
    In computing, buffer underrun or buffer underflow is a state occurring when a buffer used to communicate 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 or device reading from the buffer to pause its processing while...

  • Circular buffer
    Circular buffer
    A circular buffer, 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.-Uses:...

  • Cache
    Cache
    In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...

  • Streaming media
    Streaming media
    Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming provider.The term "presented" is used in this article in a general sense that includes audio or video playback. The name refers to the delivery method of the medium rather...

  • Frame buffer for use in graphical display
  • Double buffering
    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 version of the data, rather than a partially-updated version of the data being created by a "writer"...

     and Triple buffering for techniques mainly in graphics
  • Depth buffer, Stencil buffer
    Stencil buffer
    A stencil buffer is an extra buffer, in addition to the color buffer and depth buffer found on modern computer graphics hardware. The buffer is per pixel, and works on integer values, usually with a depth of one byte per pixel...

    , for different parts of image information
  • Variable length buffer
    Variable length buffer
    In telecommunication, a variable length buffer is a buffer into which data may be entered at one rate and removed at another rate without changing the data sequence....

  • Optical buffer
    Optical buffer
    In telecommunications, an optical buffer is a device that is capable of temporarily storing light. Just as in the case of a regular buffer, it is a storage medium that enables compensation for a difference in time of occurrence of events...

  • MissingNo.
    MissingNo.
    , or MissingNO, is a Pokémon species found in the video games Pokémon Red and Blue. Standing for "Missing Number", MissingNo. Pokémon are used as error handlers by game developer Game Freak; they appear when the game attempts to access data for a nonexistent Pokémon species. Due to the programming...

    , the result of buffer data not being cleared properly in Pokémon Red and Blue
    Pokémon Red and Blue
    Pokémon Red Version and Blue Version, originally released in Japan as , are role-playing games developed by Game Freak and published by Nintendo for the Game Boy. They are the first installments to the Pokémon series. They were first released in Japan in 1996 as Red and Green, with Blue being...

  • UART buffer
  • ENOBUFS
    ENOBUFS
    In programming, ENOBUFS is a POSIX error code defined in . This condition caused by lack of memory in the OS's buffers. Typically occurs in socket programming....

    , POSIX
    POSIX
    POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

     error caused by lack of memory in buffers
  • Write buffer
    Write buffer
    A write buffer is a type of data buffer.In a CPU cache, a write buffer can be used to hold data being written back from the cache to main memory. This is a variation of write-through caching called buffered write-through....

    , a type of memory buffer
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK