Data buffer

Buffer (english buffer) are in the computer science and telecommunications memory for temporary storage of data. Depending on the task, the buffer can be structured differently.

A buffer stores the data in the control time- wise, and can be located in a volatile, but also in a non-volatile memory.

Forms of buffer storage

Piping and queuing ( FIFO buffer)

Buffer to compensate for differences in processing speed makes it possible to tolerate storage in a processing in which the objects of processing are temporarily stored for later processing. Such buffers form a queue (English pipe, pipe ' or queue, queue ') and operate according to the First In - First Out principle. Technically, they are often implemented as a ring buffer. Buffers can be implemented in hardware or in software, with the vast number of buffers is implemented in software.

Typical applications are the print queue that buffers tasks for a printer, or the communication of system and application programs themselves, the inter-process communication.

Stacking ( LIFO buffer)

Buffer for storing a state during an interruption of the program sequence or during the " descent " in a subroutine is called, in general stack. They function after the Last In - First Out principle. They allow the program to continue after the break exactly where the interruption took place. Stack buffer are also sometimes used to earmark data in a program for later processing.

The stack is one of the earliest storage systems, computer technology, and is also at the level of machine language ( push / pop) implemented, which acts directly on the stack pointer of the microprocessor. A big disadvantage of the stack is that it has a fixed size - unabgefangener overflow leads to buffer overflow, a serious and potentially hazardous programming error and attack the basis of numerous malware.

Caching and mapping

Buffer for faster access to data on a slow storage medium is called cache (, stack '), especially in case of hardware is called mapping ( in German: " on a map Enter " )

Both means to represent a range of data in a memory. When reading this data is additionally stored in the cache so that it can be transferred directly from there when re- reading. The data in the cache are freely available via their address, the address of the underlying storage medium is simulated. Write accesses are in operation only on the image of (indirect access).

Sequential reading of data, the behavior of the cache corresponding to a FIFO buffer, a parallel process has the advantage that one side of the mapped portion can be filled, regardless of how the data is to be read.

Mapping is approximately typically used in writing to a hard disk or a USB flash drive: The operating system only works on a mapped memory from the hard data, and can therefore operate faster. Is written permanently to the HDD as at sector changes, the USB stick with the " Eject" - can not be transmitted correctly ( failure of system, management or storage unit, hasty removal ), they lost the data.

Another area of ​​application is time-critical applications. One example is the frame buffer of the monitor that is located in a protected memory area or on the graphics card, and can be filled regardless of the readout rate of the display device by the graphics driver. Special forms are double-buffering and triple buffering. Also for burning a CD, where disruption in supply would result in an error with the data you need such buffers.

Swapping and paging ( virtual memory )

The aim of the virtual memory ( virtual memory), vorzuhalten data from a faster storage medium in slower by currently unused records are outsourced. This allows the - most expensive - fast memory be made smaller - the Virtual Memory gaukelt a much larger active memory. In this case, the swapping is a complete inactive process, outsourced a memory block in the paging. Typical Page Buffer is the swap file.

Typical concepts of the criteria which processes / data is swapped, in addition to FIFO as least recently used (, longest idle ', LRU), least frequently used ( utilized least often ', LFU) or not recently used (, last unused ' NRU ).

Heaping

And memory areas fill programs for later processing of data, are used to Datenstrompufferung. To this end, the programs reserve a beyond their loaded program code memory. Today the heap based (English for stockpile, hence heap memory ) on dynamic memory allocation, which uses the operating system to request the program - typical program commands to the memory requirement are malloc () and realloc ().

Clip boarding

Clip Boarding includes the buffers only have a fixed number of seats that can be used as such but studied individually and read. The clipboard is about a made ​​available to, cross-application by the operating system free memory for caching data. They generally allows only one record, the previous file is overwritten.

  • Data structure
  • Data transmission
  • Compiler
  • Memory management
664679
de