# double buffering

> concept in computer technique

**Wikidata**: [Q1425727](https://www.wikidata.org/wiki/Q1425727)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Double_buffering)  
**Source**: https://4ort.xyz/entity/double-buffering

## Summary
Double buffering is a computer technique that uses two data buffers to prevent the display of incomplete or torn images and data. As a specific type of multiple buffering, it works by having one buffer actively display its contents while a second, "back" buffer is being written to or drawn on. This ensures that only complete frames are ever shown to the user, resulting in smoother animations and video.

## Key Facts
- **Instance of**: Technique (in computer science)
- **Subclass of**: Multiple buffering
- **Primary Use**: To avoid the reading or display of incomplete data.
- **Core Component**: Utilizes a data buffer, a temporary region of physical memory storage.
- **Related Techniques**: It is the direct predecessor to triple buffering.
- **Common Aliases**: "BackBuffer," "Doublebuffer," "hardware double buffering," and "Backbuffering."
- **Classification**: It is a specific implementation of the broader "multiple buffering" class of techniques.

## FAQs
### Q: What is double buffering a type of?
A: Double buffering is a specific subclass of multiple buffering. Multiple buffering is a general data buffering technique used in computer science to avoid issues caused by reading incomplete data.

### Q: What problem does double buffering solve?
A: Double buffering solves the problem of displaying incomplete data, which can manifest as visual artifacts like flickering or screen tearing in graphics applications. It ensures that the viewer only ever sees a fully rendered frame.

### Q: Is "BackBuffer" the same as double buffering?
A: Yes, "BackBuffer" and "Backbuffering" are common aliases for the double buffering technique. This name refers to the second, hidden buffer that is being prepared for display while the primary buffer is visible.

## Why It Matters
Double buffering is a foundational technique in computer graphics that significantly improves visual quality and performance. Its primary importance lies in solving the problem of screen tearing and flickering, which occurs when the display buffer is updated while it's being read for output. By using a second, off-screen buffer (the "back buffer") to draw the next frame, a complete image can be prepared in the background. Once ready, the buffers are swapped, so the user only ever sees finished frames.

This method is crucial for smooth animation, video playback, and interactive applications like video games. It allows complex scenes to be rendered without interrupting the visual flow, providing a stable and professional user experience. The development of double buffering was a critical step away from the limitations of single-buffered systems and established the groundwork for more advanced techniques like triple buffering, which further optimize rendering performance.

## Notable For
- **Eliminating Visual Artifacts**: It is specifically known for preventing screen tearing and flickering by ensuring only complete frames are presented to the user.
- **Use of a "Back Buffer"**: The technique is defined by its use of a secondary, non-visible buffer for rendering, which is so integral to the concept that "BackBuffer" has become a common alias.
- **A Specific Type of Multiple Buffering**: While multiple buffering is a general concept, double buffering is the most common and fundamental implementation, specifically using two buffers.
- **Foundation for Advanced Buffering**: It serves as the direct predecessor and conceptual basis for more complex techniques like triple buffering, which builds upon its principles to further reduce latency.

## Body
### Classification and Hierarchy
Double buffering is a technique within the field of computer science. It is formally classified as a subclass of the broader concept of **multiple buffering**. The technique it logically precedes and is often followed by is **triple buffering**.

- **Instance of**: Technique
- **Subclass of**: Multiple buffering
- **Followed by**: Triple buffering

### Core Function and Components
The primary function of double buffering is to prevent the reading of incomplete data. It achieves this by using a **data buffer**, which is a region of physical memory designated for temporarily storing data as it is moved or processed. In a typical double buffering setup, two such buffers are used: one (the "front buffer") is displayed, while the other (the "back buffer") is being written to.

### Terminology and Aliases
The concept is known by several names, which are often used interchangeably.
- Double buffering
- Double buffer
- Doublebuffer
- Doublebuffering
- Hardware double buffer
- Hardware double buffering
- BackBuffer
- Backbuffering
- Двойная буфферизация (Russian)