What is Buffering and its types in Operating System?

What is Buffering in OS?

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 a 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 in os

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. gives. 

Read AlsoWhat is System Call? Its types and functions in the operating system

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.

single buffering in os

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 os

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.

circular buffering in os

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