What is Buffering and it's Types in Operating System

What is Buffering?

It is a technique to use the computer's memory. In this, data is temporarily kept in memory (RAM). Normally buffering is required when data is sent from one place to another.

Buffering has many benefits such as: When you give the command to print the document, it is placed in the print buffer. Even if you close the document after this, the printing will not stop.

What is Buffering?

When we play a video from the Internet, that video is loaded in small pieces in the temporary memory (RAM) which is called a buffer.

If the internet speed is slow, then you can see it directly, when the entire video is loaded in the buffer, then you can play it without any hindrance.

Buffering in Operating System

Similarly, while doing CD_write, it keeps the data in a buffer and then writes it. The process of storing in buffer memory is called buffering. We can consider a buffer as a special area that is shared by different devices.

Buffer is required because the working speed of different devices is different and if the computer system has to work from any device, then it cannot wait till its work is completed, so transfer it to the buffer memory.

Which is used by that device. Its device keeps on doing its work and the computer is ready to do any other work.

Types of Buffering :

  1. Single Buffering
  2. Double Buffering
  3. Circular Buffering

1. Single Buffering :

In single buffering, only one buffer is used to transfer data between two devices. This is the simplest buffering that the operating system can support. In this, only when the buffer is empty, the processor produces data again.

What is single Buffering?

2. Double Buffering :

Double buffering is an extended version of single buffering. In double buffering, two schemes or two buffers are used instead of one. Therefore, the producer does not need to wait for the buffer to fill up. Double buffering is also known as buffer swapping.

Double Buffering in operating system

3. Circular Buffering :

When two or more buffers are used, it is called circular buffering. Each buffer is a unit in the circular buffer. This technique is used to solve the issue related to double buffering technology.

what is circular buffering?

Using this technique increases the data transfer rate like the double buffering technique. Sometimes when the process does fast bursts of I/O, double buffering becomes insufficient. Therefore in a circular buffer, each individual buffer acts as a unit.

Reasons of Buffering

There can be the following three main reasons for buffering in the operating system -

  • Buffering creates a synchronization between two devices with different processing speeds. For example, if the hard disk is transferring data at a very high speed and the printer is accepting the data slowly, then buffering is required in such a situation.
  • Buffering is also required in cases where two devices have different data block sizes.
  • I/O operations also require buffering to support copy semantics.

Post a Comment